CMS 3D CMS Logo

IsoTrig.h
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
4 // Root objects
5 #include "TROOT.h"
6 #include "TH1.h"
7 #include "TH2.h"
8 #include "TSystem.h"
9 #include "TFile.h"
10 #include "TProfile.h"
11 #include "TDirectory.h"
12 #include "TTree.h"
13 #include "TMath.h"
14 
15 // user include files
19 
39 
52 
54 //Tracks
56 // Vertices
60 //Triggers
66 
67 class IsoTrig : public edm::EDAnalyzer {
68 
69 public:
70  explicit IsoTrig(const edm::ParameterSet&);
71  ~IsoTrig() override;
72 
73  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
74 
75 private:
76 
77  void analyze(const edm::Event&, const edm::EventSetup&) override;
78  void beginJob() override ;
79  void endJob() override ;
80  void beginRun(edm::Run const&, edm::EventSetup const&) override;
81  void endRun(edm::Run const&, edm::EventSetup const&) override;
82  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
83  void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
84 
88  math::XYZTLorentzVector &Trkcand,
89  std::vector<double> &PixMaxP, double &TrkMaxP, bool &selTk);
91  math::XYZTLorentzVector &Trkcand,
92  double &EmipNFcand, double &EmipTrkcand,
93  double &mindR, double &mindP1,
94  std::vector<bool> &Flags, double hCone);
96  void studyTiming(const edm::Event& theEvent);
100  std::vector<reco::TrackCollection::const_iterator>&);
102  std::vector<reco::TrackCollection::const_iterator>&);
103  void chgIsolation(double& etaTriggered, double& phiTriggered,
104  edm::Handle<reco::TrackCollection>& trkCollection,
105  const edm::Event& theEvent);
107  void fillHist(int, math::XYZTLorentzVector&);
109  void fillCuts(int, double, double, double, math::XYZTLorentzVector&, int, bool);
110  void fillEnergy(int, int, double, double, math::XYZTLorentzVector&);
117  std::pair<double,double> etaPhiTrigger();
118  std::pair<double,double> GetEtaPhiAtEcal(double etaIP, double phiIP,
119  double pT, int charge, double vtxZ);
120  double getDistInCM(double eta1,double phi1, double eta2,double phi2);
121 
122  // ----------member data ---------------------------
124  std::vector<std::string> trigNames;
126  std::vector<edm::InputTag> pixelTracksSources_;
130  double rEB_, zEE_, bfVal;
131  std::vector<double> pixelIsolationConeSizeAtEC_;
139  double pLimits[6];
156  std::vector<edm::EDGetTokenT<reco::TrackCollection> > tok_pixtks_;
157 
158  std::vector<reco::TrackRef> pixelTrackRefsHB, pixelTrackRefsHE;
167 
168  std::map<unsigned int, unsigned int> TrigList;
169  std::map<unsigned int, const std::pair<int, int>> TrigPreList;
170  bool changed;
173  std::vector<double> *t_timeL2Prod;
174  std::vector<int> *t_nPixCand;
175  std::vector<int> *t_nPixSeed;
176  std::vector<int> *t_nGoodTk;
177 
178  std::vector<double> *t_TrkhCone;
179  std::vector<double> *t_TrkP;
180  std::vector<bool> *t_TrkselTkFlag;
181  std::vector<bool> *t_TrkqltyFlag;
182  std::vector<bool> *t_TrkMissFlag;
183  std::vector<bool> *t_TrkPVFlag;
184  std::vector<bool> *t_TrkNuIsolFlag;
185 
186  std::vector<double> *t_PixcandP;
187  std::vector<double> *t_PixcandPt;
188  std::vector<double> *t_PixcandEta;
189  std::vector<double> *t_PixcandPhi;
190  std::vector<std::vector<double> > *t_PixcandMaxP;
191  std::vector<double> *t_PixTrkcandP;
192  std::vector<double> *t_PixTrkcandPt;
193  std::vector<double> *t_PixTrkcandEta;
194  std::vector<double> *t_PixTrkcandPhi;
195  std::vector<double> *t_PixTrkcandMaxP;
196  std::vector<bool> *t_PixTrkcandselTk;
197 
198  std::vector<double> *t_NFcandP;
199  std::vector<double> *t_NFcandPt;
200  std::vector<double> *t_NFcandEta;
201  std::vector<double> *t_NFcandPhi;
202  std::vector<double> *t_NFcandEmip;
203  std::vector<double> *t_NFTrkcandP;
204  std::vector<double> *t_NFTrkcandPt;
205  std::vector<double> *t_NFTrkcandEta;
206  std::vector<double> *t_NFTrkcandPhi;
207  std::vector<double> *t_NFTrkcandEmip;
208  std::vector<double> *t_NFTrkMinDR;
209  std::vector<double> *t_NFTrkMinDP1;
210  std::vector<bool> *t_NFTrkselTkFlag;
211  std::vector<bool> *t_NFTrkqltyFlag;
212  std::vector<bool> *t_NFTrkMissFlag;
213  std::vector<bool> *t_NFTrkPVFlag;
214  std::vector<bool> *t_NFTrkPropFlag;
215  std::vector<bool> *t_NFTrkChgIsoFlag;
216  std::vector<bool> *t_NFTrkNeuIsoFlag;
217  std::vector<bool> *t_NFTrkMipFlag;
218  std::vector<double> *t_ECone;
219 
220  TH1D *h_EnIn, *h_EnOut;
222  TH1I *h_nHLT, *h_HLT, *h_PreL1, *h_PreHLT;
225  TH1D *h_p[20], *h_pt[20], *h_eta[20], *h_phi[20];
226  TH1D *h_dEtaL1[2], *h_dPhiL1[2], *h_dRL1[2];
227  TH1D *h_dEta[9], *h_dPhi[9], *h_dPt[9], *h_dP[9];
228  TH1D *h_dinvPt[9], *h_mindR[9], *h_eMip[2];
229  TH1D *h_eMaxNearP[2], *h_eNeutIso[2];
230  TH1D *h_etaCalibTracks[5][2][2],*h_etaMipTracks[5][2][2];
231  TH1D *h_eHcal[5][6][48], *h_eCalo[5][6][48];
233  std::vector<math::XYZTLorentzVector> vec[3];
234 
235 };
double prelimCone_
Definition: IsoTrig.h:133
std::vector< bool > * t_NFTrkPVFlag
Definition: IsoTrig.h:213
std::vector< double > * t_PixTrkcandPhi
Definition: IsoTrig.h:194
std::vector< double > * t_PixTrkcandP
Definition: IsoTrig.h:191
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:823
double tauUnbiasCone_
Definition: IsoTrig.h:133
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_l2cand_
Definition: IsoTrig.h:155
double a_coneR
Definition: IsoTrig.h:136
edm::InputTag L1candTag_
Definition: IsoTrig.h:125
std::vector< double > * t_NFTrkMinDR
Definition: IsoTrig.h:208
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:817
void chgIsolation(double &etaTriggered, double &phiTriggered, edm::Handle< reco::TrackCollection > &trkCollection, const edm::Event &theEvent)
Definition: IsoTrig.cc:1420
std::vector< bool > * t_NFTrkMissFlag
Definition: IsoTrig.h:212
~IsoTrig() override
Definition: IsoTrig.cc:157
std::vector< reco::TrackRef > pixelTrackRefsHE
Definition: IsoTrig.h:158
double dr_L1
Definition: IsoTrig.h:136
edm::EDGetTokenT< LumiDetails > tok_lumi
Definition: IsoTrig.h:140
TH1D * h_phi[20]
Definition: IsoTrig.h:225
std::vector< bool > * t_PixTrkcandselTk
Definition: IsoTrig.h:196
TH1D * h_EnIn
Definition: IsoTrig.h:220
bool doStudyIsol
Definition: IsoTrig.h:128
TH1D * h_dEta[9]
Definition: IsoTrig.h:227
edm::EDGetTokenT< SiPixelRecHitCollection > tok_SiPixelRecHits
Definition: IsoTrig.h:152
void studyIsolation(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1303
std::vector< double > * t_NFTrkcandEta
Definition: IsoTrig.h:205
std::vector< double > * t_NFcandP
Definition: IsoTrig.h:198
edm::Handle< EcalRecHitCollection > barrelRecHitsHandle
Definition: IsoTrig.h:162
void endJob() override
Definition: IsoTrig.cc:790
TH1D * h_dEtaL1[2]
Definition: IsoTrig.h:226
bool doTiming
Definition: IsoTrig.h:127
std::string theTrackQuality
Definition: IsoTrig.h:135
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: IsoTrig.h:147
TH1I * g_PreHLT
Definition: IsoTrig.h:232
math::XYZPoint leadPV
Definition: IsoTrig.h:166
std::vector< reco::TrackRef > pixelTrackRefsHB
Definition: IsoTrig.h:158
bool changed
Definition: IsoTrig.h:170
std::vector< math::XYZTLorentzVector > vec[3]
Definition: IsoTrig.h:233
std::vector< int > * t_nPixSeed
Definition: IsoTrig.h:175
std::vector< double > * t_TrkhCone
Definition: IsoTrig.h:178
double rEB_
Definition: IsoTrig.h:130
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_pixtk_
Definition: IsoTrig.h:153
std::vector< bool > * t_NFTrkqltyFlag
Definition: IsoTrig.h:211
bool doTrkResTree
Definition: IsoTrig.h:128
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
Definition: IsoTrig.cc:1730
std::vector< double > * t_PixTrkcandMaxP
Definition: IsoTrig.h:195
std::vector< bool > * t_NFTrkselTkFlag
Definition: IsoTrig.h:210
TH1I * h_HLT
Definition: IsoTrig.h:222
double dP(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1706
std::vector< double > * t_PixcandP
Definition: IsoTrig.h:186
std::vector< std::string > trigNames
Definition: IsoTrig.h:124
std::pair< double, double > etaPhiTrigger()
Definition: IsoTrig.cc:1714
TH1D * h_dP[9]
Definition: IsoTrig.h:227
double vtxCutIsol_
Definition: IsoTrig.h:132
std::vector< bool > * t_NFTrkMipFlag
Definition: IsoTrig.h:217
double a_neutIsoR
Definition: IsoTrig.h:136
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:826
void pushMipCutTreeVecs(math::XYZTLorentzVector &NFcand, math::XYZTLorentzVector &Trkcand, double &EmipNFcand, double &EmipTrkcand, double &mindR, double &mindP1, std::vector< bool > &Flags, double hCone)
Definition: IsoTrig.cc:501
std::vector< double > * t_NFTrkMinDP1
Definition: IsoTrig.h:209
TH1D * h_EnOut
Definition: IsoTrig.h:220
TH1D * h_dPhiL1[2]
Definition: IsoTrig.h:226
TH1D * h_L1ObjEnergy
Definition: IsoTrig.h:224
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: IsoTrig.cc:213
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::InputTag PixcandTag_
Definition: IsoTrig.h:125
void studyMipCut(edm::Handle< reco::TrackCollection > &trkCollection, edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &L2cands)
Definition: IsoTrig.cc:1056
HLTPrescaleProvider hltPrescaleProvider_
Definition: IsoTrig.h:123
double dinvPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1710
int maxRunNo
Definition: IsoTrig.h:138
double bfVal
Definition: IsoTrig.h:130
int verbosity
Definition: IsoTrig.h:129
TH1D * h_dPhi[9]
Definition: IsoTrig.h:227
edm::ESHandle< CaloGeometry > pG
Definition: IsoTrig.h:160
void studyTrigger(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1171
void fillHist(int, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1622
std::vector< double > * t_NFTrkcandP
Definition: IsoTrig.h:203
edm::Handle< HBHERecHitCollection > hbhe
Definition: IsoTrig.h:161
std::vector< bool > * t_TrkNuIsolFlag
Definition: IsoTrig.h:184
TH1I * h_nHLT
Definition: IsoTrig.h:222
double a_mipR
Definition: IsoTrig.h:136
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
Definition: IsoTrig.h:146
std::vector< bool > * t_TrkPVFlag
Definition: IsoTrig.h:183
std::vector< double > * t_ECone
Definition: IsoTrig.h:218
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: IsoTrig.h:144
double cutNeutral
Definition: IsoTrig.h:137
TTree * ChgIsolnTree
Definition: IsoTrig.h:172
TH1I * h_Pre
Definition: IsoTrig.h:223
TH1I * h_PreHLT
Definition: IsoTrig.h:222
TH1D * h_dinvPt[9]
Definition: IsoTrig.h:228
void fillEnergy(int, int, double, double, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1666
double a_charIsoR
Definition: IsoTrig.h:136
edm::Handle< reco::VertexCollection > recVtxs
Definition: IsoTrig.h:165
double zEE_
Definition: IsoTrig.h:130
std::vector< bool > * t_NFTrkChgIsoFlag
Definition: IsoTrig.h:215
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tok_pixtks_
Definition: IsoTrig.h:156
std::vector< double > * t_TrkP
Definition: IsoTrig.h:179
double minPTrackValue_
Definition: IsoTrig.h:132
TH1D * h_eta[20]
Definition: IsoTrig.h:225
double cutCharge
Definition: IsoTrig.h:137
TH1I * h_Filters
Definition: IsoTrig.h:223
std::vector< double > * t_NFcandEta
Definition: IsoTrig.h:200
std::vector< double > * t_timeL2Prod
Definition: IsoTrig.h:173
void beginJob() override
Definition: IsoTrig.cc:529
TH1D * h_eHcal[5][6][48]
Definition: IsoTrig.h:231
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: IsoTrig.h:148
TTree * MipCutTree
Definition: IsoTrig.h:172
bool doL2L3
Definition: IsoTrig.h:127
IsoTrig(const edm::ParameterSet &)
Definition: IsoTrig.cc:29
std::vector< double > * t_PixcandPt
Definition: IsoTrig.h:187
double a_neutR2
Definition: IsoTrig.h:137
TH1D * h_PreL1wt
Definition: IsoTrig.h:224
std::map< unsigned int, const std::pair< int, int > > TrigPreList
Definition: IsoTrig.h:169
std::vector< double > * t_NFcandEmip
Definition: IsoTrig.h:202
TH1D * h_eMaxNearP[2]
Definition: IsoTrig.h:229
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1684
void studyTiming(const edm::Event &theEvent)
Definition: IsoTrig.cc:945
void clearChgIsolnTreeVectors()
Definition: IsoTrig.cc:444
std::vector< bool > * t_NFTrkPropFlag
Definition: IsoTrig.h:214
std::vector< double > * t_NFTrkcandPhi
Definition: IsoTrig.h:206
TH2D * h_MipEnMatch
Definition: IsoTrig.h:221
TH1D * h_p[20]
Definition: IsoTrig.h:225
TH1D * h_eNeutIso[2]
Definition: IsoTrig.h:229
TH1I * h_PreL1
Definition: IsoTrig.h:222
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: IsoTrig.h:142
int minRunNo
Definition: IsoTrig.h:138
edm::InputTag L2candTag_
Definition: IsoTrig.h:125
std::vector< bool > * t_TrkMissFlag
Definition: IsoTrig.h:182
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
Definition: IsoTrig.cc:1789
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: IsoTrig.h:145
std::vector< int > * t_nPixCand
Definition: IsoTrig.h:174
void StudyTrkEbyP(edm::Handle< reco::TrackCollection > &trkCollection)
Definition: IsoTrig.cc:831
std::vector< double > * t_NFTrkcandPt
Definition: IsoTrig.h:204
TH1D * h_eCalo[5][6][48]
Definition: IsoTrig.h:231
TH1I * g_Pre
Definition: IsoTrig.h:232
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::Handle< reco::BeamSpot > beamSpotH
Definition: IsoTrig.h:164
std::vector< double > * t_PixTrkcandPt
Definition: IsoTrig.h:192
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1680
edm::EDGetTokenT< reco::VertexCollection > tok_verthb_
Definition: IsoTrig.h:150
bool doChgIsolTree
Definition: IsoTrig.h:128
std::vector< double > * t_NFcandPt
Definition: IsoTrig.h:199
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: IsoTrig.cc:205
spr::trackSelectionParameters selectionParameters
Definition: IsoTrig.h:134
TH1D * h_pt[20]
Definition: IsoTrig.h:225
std::map< unsigned int, unsigned int > TrigList
Definition: IsoTrig.h:168
std::vector< bool > * t_TrkqltyFlag
Definition: IsoTrig.h:181
TH1D * h_etaMipTracks[5][2][2]
Definition: IsoTrig.h:230
std::vector< std::vector< double > > * t_PixcandMaxP
Definition: IsoTrig.h:190
std::vector< double > * t_NFTrkcandEmip
Definition: IsoTrig.h:207
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_l1cand_
Definition: IsoTrig.h:154
std::vector< edm::InputTag > pixelTracksSources_
Definition: IsoTrig.h:126
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerhb
Definition: IsoTrig.h:151
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1696
TH1D * h_mindR[9]
Definition: IsoTrig.h:228
double a_neutR1
Definition: IsoTrig.h:137
void clearMipCutTreeVectors()
Definition: IsoTrig.cc:460
std::vector< double > * t_PixcandEta
Definition: IsoTrig.h:188
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: IsoTrig.h:149
double vtxCutSeed_
Definition: IsoTrig.h:132
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerhe
Definition: IsoTrig.h:151
void fillDifferences(int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
Definition: IsoTrig.cc:1629
TH1D * h_dPt[9]
Definition: IsoTrig.h:227
TH2D * h_MipEnNoMatch
Definition: IsoTrig.h:221
double dPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1702
std::vector< bool > * t_NFTrkNeuIsoFlag
Definition: IsoTrig.h:216
edm::Handle< EcalRecHitCollection > endcapRecHitsHandle
Definition: IsoTrig.h:163
TTree * TrkResTree
Definition: IsoTrig.h:172
std::vector< double > * t_PixcandPhi
Definition: IsoTrig.h:189
std::vector< double > * t_PixTrkcandEta
Definition: IsoTrig.h:193
bool doMipCutTree
Definition: IsoTrig.h:127
edm::Service< TFileService > fs
Definition: IsoTrig.h:171
std::vector< int > * t_nGoodTk
Definition: IsoTrig.h:176
TTree * TimingTree
Definition: IsoTrig.h:172
double pLimits[6]
Definition: IsoTrig.h:139
TH1I * g_PreL1
Definition: IsoTrig.h:232
edm::ESHandle< MagneticField > bFieldH
Definition: IsoTrig.h:159
edm::EDGetTokenT< reco::VertexCollection > tok_verthe_
Definition: IsoTrig.h:150
TH1I * h_nL3Objs
Definition: IsoTrig.h:223
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
Definition: IsoTrig.h:143
void getGoodTracks(const edm::Event &, edm::Handle< reco::TrackCollection > &)
Definition: IsoTrig.cc:1531
TH1D * h_dRL1[2]
Definition: IsoTrig.h:226
TH1D * h_etaCalibTracks[5][2][2]
Definition: IsoTrig.h:230
std::vector< bool > * t_TrkselTkFlag
Definition: IsoTrig.h:180
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:828
double cutMip
Definition: IsoTrig.h:137
std::string processName
Definition: IsoTrig.h:135
void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool)
Definition: IsoTrig.cc:1648
Definition: Run.h:43
TH1D * h_PreHLTwt
Definition: IsoTrig.h:224
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: IsoTrig.h:141
std::vector< double > pixelIsolationConeSizeAtEC_
Definition: IsoTrig.h:131
void pushChgIsolnTreeVecs(math::XYZTLorentzVector &Pixcand, math::XYZTLorentzVector &Trkcand, std::vector< double > &PixMaxP, double &TrkMaxP, bool &selTk)
Definition: IsoTrig.cc:484
TH1I * g_Accepts
Definition: IsoTrig.h:232
TH1D * h_eMip[2]
Definition: IsoTrig.h:228
std::vector< double > * t_NFcandPhi
Definition: IsoTrig.h:201