Skip to content

Commit

Permalink
First implementation fully using generic fillers
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Battilana committed Apr 5, 2023
1 parent 01c9114 commit ddf5a8a
Show file tree
Hide file tree
Showing 40 changed files with 648 additions and 2,356 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MuNtuple_MuNtupleCSCTnPFiller_h
#define MuNtuple_MuNtupleCSCTnPFiller_h
#ifndef MuNtuple_MuCSCTnPFlatTableProducer_h
#define MuNtuple_MuCSCTnPFlatTableProducer_h

/** \class MuNtupleCSCTnPFiller MuNtupleCSCTnPFiller.h MuDPGAnalysis/MuonDPGNtuples/plugins/MuNtupleCSCTnPFiller.h
/** \class MuCSCTnPFlatTableProducer MuCSCTnPFlatTableProducer.h MuDPGAnalysis/MuonDPGNtuples/plugins/MuCSCTnPFlatTableProducer.h
*
* Helper class : CSC Tag and Probe Segement Efficiency Filler
*
Expand All @@ -10,7 +10,7 @@
*
*/

#include "DPGAnalysis/MuonTools/src/MuNtupleBaseFiller.h"
#include "DPGAnalysis/MuonTools/src/MuBaseFlatTableProducer.h"

#include "FWCore/Framework/interface/ESHandle.h"

Expand Down Expand Up @@ -44,23 +44,23 @@

class MuonServiceProxy;

class MuNtupleCSCTnPFiller : public MuNtupleBaseFiller {
class MuCSCTnPFlatTableProducer : public MuBaseFlatTableProducer {
public:
/// Constructor
MuNtupleCSCTnPFiller(const edm::ParameterSet &l);
MuCSCTnPFlatTableProducer(const edm::ParameterSet &);

/// Fill descriptors
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
static void fillDescriptions(edm::ConfigurationDescriptions &);

protected:
/// Fill tree branches for a given events
virtual void fill(edm::Event &ev) final;
virtual void fillTable(edm::Event &) final;

/// Get info from the ES by run
virtual void getFromES(const edm::Run &run, const edm::EventSetup &environment) final;
virtual void getFromES(const edm::Run &, const edm::EventSetup &) final;

/// Get info from the ES for a given event
virtual void getFromES(const edm::EventSetup &environment) final;
virtual void getFromES(const edm::EventSetup &) final;


private:
Expand Down Expand Up @@ -108,27 +108,27 @@ class MuNtupleCSCTnPFiller : public MuNtupleBaseFiller {

/// Selection functions
//bool muonTagSelection(const reco::Muon & muon,edm::Handle<std::vector<reco::Track>> tracks);
bool trackProbeSelection(const reco::Track & track,edm::Handle<std::vector<reco::Track>> tracks);
bool muonTagSelection(const reco::Muon & muon);
bool trackProbeSelection(const reco::Track & track,edm::Handle<std::vector<reco::Track>>);
bool muonTagSelection(const reco::Muon &);
//bool trackProbeSelection(const reco::Track & track);
bool zSelection(const reco::Muon & muon,const reco::Track & track);
bool zSelection(const reco::Muon &,const reco::Track &);

// Calculation functions
double zMass(const reco::Track & track,const reco::Muon & muon);
double calcDeltaR(double eta1, double eta2, double phi1, double phi2);
double iso(const reco::Track& track,edm::Handle<std::vector<reco::Track>> tracks);
double zMass(const reco::Track &,const reco::Muon &);
double calcDeltaR(double, double, double, double);
double iso(const reco::Track&,edm::Handle<std::vector<reco::Track>>);

// Track extrapolation and segment match functions
TrajectoryStateOnSurface surfExtrapTrkSam(const reco::Track & track, double z);
FreeTrajectoryState freeTrajStateMuon(const reco::Track & track);
TrajectoryStateOnSurface surfExtrapTrkSam(const reco::Track &, double);
FreeTrajectoryState freeTrajStateMuon(const reco::Track &);

UChar_t ringCandidate(Int_t iiStation, Int_t station, Float_t feta, Float_t phi);
UChar_t thisChamberCandidate(UChar_t station, UChar_t ring, Float_t phi);

TrajectoryStateOnSurface* matchTTwithCSCSeg(const reco::Track & track, edm::Handle<CSCSegmentCollection> cscSegments,CSCSegmentCollection::const_iterator &cscSegOut, CSCDetId & idCSC );
Float_t TrajectoryDistToSeg( TrajectoryStateOnSurface TrajSuf, CSCSegmentCollection::const_iterator segIt);
std::vector<Float_t> GetEdgeAndDistToGap(const reco::Track & track, CSCDetId & detid);
Float_t YDistToHVDeadZone(Float_t yLocal, Int_t StationAndRing);
TrajectoryStateOnSurface* matchTTwithCSCSeg(const reco::Track &, edm::Handle<CSCSegmentCollection> ,CSCSegmentCollection::const_iterator &, CSCDetId &);
Float_t TrajectoryDistToSeg( TrajectoryStateOnSurface, CSCSegmentCollection::const_iterator);
std::vector<Float_t> GetEdgeAndDistToGap(const reco::Track & , CSCDetId & );
Float_t YDistToHVDeadZone(Float_t, Int_t);

/// The variables holding
/// the T&P related information
Expand All @@ -139,13 +139,13 @@ class MuNtupleCSCTnPFiller : public MuNtupleBaseFiller {
double _muonIso;
double _zMass;

bool hasTrigger(std::vector<int> &trigIndices,
const trigger::TriggerObjectCollection &trigObjs,
edm::Handle<trigger::TriggerEvent> &trigEvent,
const reco::Muon &muon);
bool hasTrigger(std::vector<int> &,
const trigger::TriggerObjectCollection &,
edm::Handle<trigger::TriggerEvent> &,
const reco::Muon &);

float computeTrkIso(const reco::MuonIsolation &isolation, float muonPt);
float computePFIso(const reco::MuonPFIsolation &PFisolation, float muonPt);
float computeTrkIso(const reco::MuonIsolation &, float);
float computePFIso(const reco::MuonPFIsolation &, float);
};

#endif
Loading

0 comments on commit ddf5a8a

Please sign in to comment.