CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
37 
50 
52 //Tracks
54 // Vertices
58 //Triggers
64 
65 class IsoTrig : public edm::EDAnalyzer {
66 
67 public:
68  explicit IsoTrig(const edm::ParameterSet&);
69  ~IsoTrig();
70 
71  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
72 
73 private:
74 
75  virtual void analyze(const edm::Event&, const edm::EventSetup&);
76  virtual void beginJob() ;
77  virtual void endJob() ;
78  virtual void beginRun(edm::Run const&, edm::EventSetup const&);
79  virtual void endRun(edm::Run const&, edm::EventSetup const&);
80  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
81  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
82 
86  math::XYZTLorentzVector &Trkcand,
87  std::vector<double> &PixMaxP, double &TrkMaxP, bool &selTk);
89  math::XYZTLorentzVector &Trkcand,
90  double &EmipNFcand, double &EmipTrkcand,
91  double &mindR, double &mindP1,
92  std::vector<bool> &Flags, double hCone);
94  void studyTiming(const edm::Event& theEvent);
98  std::vector<reco::TrackCollection::const_iterator>&);
100  std::vector<reco::TrackCollection::const_iterator>&);
101  void chgIsolation(double& etaTriggered, double& phiTriggered,
102  edm::Handle<reco::TrackCollection>& trkCollection,
103  const edm::Event& theEvent);
104  void fillHist(int, math::XYZTLorentzVector&);
106  void fillCuts(int, double, double, double, math::XYZTLorentzVector&, int, bool);
107  void fillEnergy(int, int, double, double, math::XYZTLorentzVector&);
114  std::pair<double,double> etaPhiTrigger();
115  std::pair<double,double> GetEtaPhiAtEcal(double etaIP, double phiIP,
116  double pT, int charge, double vtxZ);
117  double getDistInCM(double eta1,double phi1, double eta2,double phi2);
118 
119  // ----------member data ---------------------------
121  std::vector<std::string> trigNames;
123  std::vector<edm::InputTag> pixelTracksSources_;
127  double rEB_, zEE_, bfVal;
128  std::vector<double> pixelIsolationConeSizeAtEC_;
136  double pLimits[6];
140 
149 
153  std::vector<edm::EDGetTokenT<reco::TrackCollection> > tok_pixtks_;
154 
155  std::vector<reco::TrackRef> pixelTrackRefsHB, pixelTrackRefsHE;
164 
165  std::map<unsigned int, unsigned int> TrigList;
166  std::map<unsigned int, const std::pair<int, int>> TrigPreList;
167  bool changed;
170  std::vector<double> *t_timeL2Prod;
171  std::vector<int> *t_nPixCand;
172  std::vector<int> *t_nPixSeed;
173 
174  std::vector<double> *t_TrkhCone;
175  std::vector<double> *t_TrkP;
176  std::vector<bool> *t_TrkselTkFlag;
177  std::vector<bool> *t_TrkqltyFlag;
178  std::vector<bool> *t_TrkMissFlag;
179  std::vector<bool> *t_TrkPVFlag;
180  std::vector<bool> *t_TrkNuIsolFlag;
181 
182  std::vector<double> *t_PixcandP;
183  std::vector<double> *t_PixcandPt;
184  std::vector<double> *t_PixcandEta;
185  std::vector<double> *t_PixcandPhi;
186  std::vector<std::vector<double> > *t_PixcandMaxP;
187  std::vector<double> *t_PixTrkcandP;
188  std::vector<double> *t_PixTrkcandPt;
189  std::vector<double> *t_PixTrkcandEta;
190  std::vector<double> *t_PixTrkcandPhi;
191  std::vector<double> *t_PixTrkcandMaxP;
192  std::vector<bool> *t_PixTrkcandselTk;
193 
194  std::vector<double> *t_NFcandP;
195  std::vector<double> *t_NFcandPt;
196  std::vector<double> *t_NFcandEta;
197  std::vector<double> *t_NFcandPhi;
198  std::vector<double> *t_NFcandEmip;
199  std::vector<double> *t_NFTrkcandP;
200  std::vector<double> *t_NFTrkcandPt;
201  std::vector<double> *t_NFTrkcandEta;
202  std::vector<double> *t_NFTrkcandPhi;
203  std::vector<double> *t_NFTrkcandEmip;
204  std::vector<double> *t_NFTrkMinDR;
205  std::vector<double> *t_NFTrkMinDP1;
206  std::vector<bool> *t_NFTrkselTkFlag;
207  std::vector<bool> *t_NFTrkqltyFlag;
208  std::vector<bool> *t_NFTrkMissFlag;
209  std::vector<bool> *t_NFTrkPVFlag;
210  std::vector<bool> *t_NFTrkPropFlag;
211  std::vector<bool> *t_NFTrkChgIsoFlag;
212  std::vector<bool> *t_NFTrkNeuIsoFlag;
213  std::vector<bool> *t_NFTrkMipFlag;
214  std::vector<double> *t_ECone;
215 
216  TH1D *h_EnIn, *h_EnOut;
218  TH1I *h_nHLT, *h_HLT, *h_PreL1, *h_PreHLT,
221  TH1D *h_p[20], *h_pt[20], *h_eta[20], *h_phi[20];
222  TH1D *h_dEtaL1[2], *h_dPhiL1[2], *h_dRL1[2];
223  TH1D *h_dEta[9], *h_dPhi[9], *h_dPt[9], *h_dP[9];
224  TH1D *h_dinvPt[9], *h_mindR[9], *h_eMip[2];
225  TH1D *h_eMaxNearP[2], *h_eNeutIso[2];
226  TH1D *h_etaCalibTracks[5][2][2],*h_etaMipTracks[5][2][2];
227  TH1D *h_eHcal[5][6][48], *h_eCalo[5][6][48];
229  std::vector<math::XYZTLorentzVector> vec[3];
230 
231 };
double prelimCone_
Definition: IsoTrig.h:130
std::vector< bool > * t_NFTrkPVFlag
Definition: IsoTrig.h:209
std::vector< double > * t_PixTrkcandPhi
Definition: IsoTrig.h:190
std::vector< double > * t_PixTrkcandP
Definition: IsoTrig.h:187
double tauUnbiasCone_
Definition: IsoTrig.h:130
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_l2cand_
Definition: IsoTrig.h:152
double a_coneR
Definition: IsoTrig.h:133
edm::InputTag L1candTag_
Definition: IsoTrig.h:122
std::vector< double > * t_NFTrkMinDR
Definition: IsoTrig.h:204
void chgIsolation(double &etaTriggered, double &phiTriggered, edm::Handle< reco::TrackCollection > &trkCollection, const edm::Event &theEvent)
Definition: IsoTrig.cc:1309
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: IsoTrig.cc:744
std::vector< bool > * t_NFTrkMissFlag
Definition: IsoTrig.h:208
std::vector< reco::TrackRef > pixelTrackRefsHE
Definition: IsoTrig.h:155
double dr_L1
Definition: IsoTrig.h:133
edm::EDGetTokenT< LumiDetails > tok_lumi
Definition: IsoTrig.h:137
TH1D * h_phi[20]
Definition: IsoTrig.h:221
std::vector< bool > * t_PixTrkcandselTk
Definition: IsoTrig.h:192
TH1D * h_EnIn
Definition: IsoTrig.h:216
bool doStudyIsol
Definition: IsoTrig.h:124
TH1D * h_dEta[9]
Definition: IsoTrig.h:223
void studyIsolation(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1195
TH1I * h_Pre
Definition: IsoTrig.h:218
std::vector< double > * t_NFTrkcandEta
Definition: IsoTrig.h:201
std::vector< double > * t_NFcandP
Definition: IsoTrig.h:194
edm::Handle< EcalRecHitCollection > barrelRecHitsHandle
Definition: IsoTrig.h:159
TH1D * h_dEtaL1[2]
Definition: IsoTrig.h:222
bool doTiming
Definition: IsoTrig.h:124
std::string theTrackQuality
Definition: IsoTrig.h:132
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: IsoTrig.h:144
TH1I * g_PreHLT
Definition: IsoTrig.h:228
math::XYZPoint leadPV
Definition: IsoTrig.h:163
std::vector< reco::TrackRef > pixelTrackRefsHB
Definition: IsoTrig.h:155
bool changed
Definition: IsoTrig.h:167
std::vector< math::XYZTLorentzVector > vec[3]
Definition: IsoTrig.h:229
std::vector< int > * t_nPixSeed
Definition: IsoTrig.h:172
std::vector< double > * t_TrkhCone
Definition: IsoTrig.h:174
double rEB_
Definition: IsoTrig.h:127
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_pixtk_
Definition: IsoTrig.h:150
std::vector< bool > * t_NFTrkqltyFlag
Definition: IsoTrig.h:207
bool doTrkResTree
Definition: IsoTrig.h:124
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
Definition: IsoTrig.cc:1535
std::vector< double > * t_PixTrkcandMaxP
Definition: IsoTrig.h:191
std::vector< bool > * t_NFTrkselTkFlag
Definition: IsoTrig.h:206
TH1I * h_HLT
Definition: IsoTrig.h:218
double dP(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1511
std::vector< double > * t_PixcandP
Definition: IsoTrig.h:182
std::vector< std::string > trigNames
Definition: IsoTrig.h:121
std::pair< double, double > etaPhiTrigger()
Definition: IsoTrig.cc:1519
TH1D * h_dP[9]
Definition: IsoTrig.h:223
virtual void beginJob()
Definition: IsoTrig.cc:448
HLTConfigProvider hltConfig_
Definition: IsoTrig.h:120
double vtxCutIsol_
Definition: IsoTrig.h:129
std::vector< bool > * t_NFTrkMipFlag
Definition: IsoTrig.h:213
double a_neutIsoR
Definition: IsoTrig.h:133
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:420
std::vector< double > * t_NFTrkMinDP1
Definition: IsoTrig.h:205
TH1D * h_EnOut
Definition: IsoTrig.h:216
TH1D * h_dPhiL1[2]
Definition: IsoTrig.h:222
TH1D * h_L1ObjEnergy
Definition: IsoTrig.h:220
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::InputTag PixcandTag_
Definition: IsoTrig.h:122
void studyMipCut(edm::Handle< reco::TrackCollection > &trkCollection, edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &L2cands)
Definition: IsoTrig.cc:949
double dinvPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1515
int maxRunNo
Definition: IsoTrig.h:135
double bfVal
Definition: IsoTrig.h:127
int verbosity
Definition: IsoTrig.h:126
TH1D * h_dPhi[9]
Definition: IsoTrig.h:223
edm::ESHandle< CaloGeometry > pG
Definition: IsoTrig.h:157
void studyTrigger(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1074
void fillHist(int, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1429
std::vector< double > * t_NFTrkcandP
Definition: IsoTrig.h:199
edm::Handle< HBHERecHitCollection > hbhe
Definition: IsoTrig.h:158
std::vector< bool > * t_TrkNuIsolFlag
Definition: IsoTrig.h:180
TH1I * h_nHLT
Definition: IsoTrig.h:218
double a_mipR
Definition: IsoTrig.h:133
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
Definition: IsoTrig.h:143
std::vector< bool > * t_TrkPVFlag
Definition: IsoTrig.h:179
std::vector< double > * t_ECone
Definition: IsoTrig.h:214
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: IsoTrig.h:141
double cutNeutral
Definition: IsoTrig.h:134
TTree * ChgIsolnTree
Definition: IsoTrig.h:169
TH1I * h_PreHLT
Definition: IsoTrig.h:218
TH1D * h_dinvPt[9]
Definition: IsoTrig.h:224
void fillEnergy(int, int, double, double, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1471
double a_charIsoR
Definition: IsoTrig.h:133
edm::Handle< reco::VertexCollection > recVtxs
Definition: IsoTrig.h:162
double zEE_
Definition: IsoTrig.h:127
std::vector< bool > * t_NFTrkChgIsoFlag
Definition: IsoTrig.h:211
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tok_pixtks_
Definition: IsoTrig.h:153
std::vector< double > * t_TrkP
Definition: IsoTrig.h:175
double minPTrackValue_
Definition: IsoTrig.h:129
TH1D * h_eta[20]
Definition: IsoTrig.h:221
double cutCharge
Definition: IsoTrig.h:134
TH1I * h_Filters
Definition: IsoTrig.h:218
std::vector< double > * t_NFcandEta
Definition: IsoTrig.h:196
std::vector< double > * t_timeL2Prod
Definition: IsoTrig.h:170
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: IsoTrig.cc:153
TH1D * h_eHcal[5][6][48]
Definition: IsoTrig.h:227
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: IsoTrig.h:145
TTree * MipCutTree
Definition: IsoTrig.h:169
bool doL2L3
Definition: IsoTrig.h:124
IsoTrig(const edm::ParameterSet &)
Definition: IsoTrig.cc:29
virtual void endJob()
Definition: IsoTrig.cc:707
std::vector< double > * t_PixcandPt
Definition: IsoTrig.h:183
double a_neutR2
Definition: IsoTrig.h:134
TH1D * h_PreL1wt
Definition: IsoTrig.h:220
std::map< unsigned int, const std::pair< int, int > > TrigPreList
Definition: IsoTrig.h:166
std::vector< double > * t_NFcandEmip
Definition: IsoTrig.h:198
TH1D * h_eMaxNearP[2]
Definition: IsoTrig.h:225
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1489
void studyTiming(const edm::Event &theEvent)
Definition: IsoTrig.cc:852
void clearChgIsolnTreeVectors()
Definition: IsoTrig.cc:363
std::vector< bool > * t_NFTrkPropFlag
Definition: IsoTrig.h:210
std::vector< double > * t_NFTrkcandPhi
Definition: IsoTrig.h:202
TH2D * h_MipEnMatch
Definition: IsoTrig.h:217
TH1D * h_p[20]
Definition: IsoTrig.h:221
TH1D * h_eNeutIso[2]
Definition: IsoTrig.h:225
TH1I * h_PreL1
Definition: IsoTrig.h:218
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: IsoTrig.h:139
int minRunNo
Definition: IsoTrig.h:135
edm::InputTag L2candTag_
Definition: IsoTrig.h:122
std::vector< bool > * t_TrkMissFlag
Definition: IsoTrig.h:178
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
Definition: IsoTrig.cc:1594
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: IsoTrig.h:142
std::vector< int > * t_nPixCand
Definition: IsoTrig.h:171
void StudyTrkEbyP(edm::Handle< reco::TrackCollection > &trkCollection)
Definition: IsoTrig.cc:747
std::vector< double > * t_NFTrkcandPt
Definition: IsoTrig.h:200
TH1D * h_eCalo[5][6][48]
Definition: IsoTrig.h:227
TH1I * g_Pre
Definition: IsoTrig.h:228
virtual void endRun(edm::Run const &, edm::EventSetup const &)
Definition: IsoTrig.cc:739
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::Handle< reco::BeamSpot > beamSpotH
Definition: IsoTrig.h:161
std::vector< double > * t_PixTrkcandPt
Definition: IsoTrig.h:188
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1485
edm::EDGetTokenT< reco::VertexCollection > tok_verthb_
Definition: IsoTrig.h:148
bool doChgIsolTree
Definition: IsoTrig.h:124
std::vector< double > * t_NFcandPt
Definition: IsoTrig.h:195
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: IsoTrig.cc:145
spr::trackSelectionParameters selectionParameters
Definition: IsoTrig.h:131
TH1D * h_pt[20]
Definition: IsoTrig.h:221
std::map< unsigned int, unsigned int > TrigList
Definition: IsoTrig.h:165
std::vector< bool > * t_TrkqltyFlag
Definition: IsoTrig.h:177
TH1D * h_etaMipTracks[5][2][2]
Definition: IsoTrig.h:226
std::vector< std::vector< double > > * t_PixcandMaxP
Definition: IsoTrig.h:186
std::vector< double > * t_NFTrkcandEmip
Definition: IsoTrig.h:203
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_l1cand_
Definition: IsoTrig.h:151
std::vector< edm::InputTag > pixelTracksSources_
Definition: IsoTrig.h:123
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1501
TH1D * h_mindR[9]
Definition: IsoTrig.h:224
double a_neutR1
Definition: IsoTrig.h:134
void clearMipCutTreeVectors()
Definition: IsoTrig.cc:379
std::vector< double > * t_PixcandEta
Definition: IsoTrig.h:184
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: IsoTrig.h:146
double vtxCutSeed_
Definition: IsoTrig.h:129
void fillDifferences(int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
Definition: IsoTrig.cc:1436
TH1D * h_dPt[9]
Definition: IsoTrig.h:223
TH2D * h_MipEnNoMatch
Definition: IsoTrig.h:217
double dPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:1507
std::vector< bool > * t_NFTrkNeuIsoFlag
Definition: IsoTrig.h:212
edm::Handle< EcalRecHitCollection > endcapRecHitsHandle
Definition: IsoTrig.h:160
TTree * TrkResTree
Definition: IsoTrig.h:169
std::vector< double > * t_PixcandPhi
Definition: IsoTrig.h:185
std::vector< double > * t_PixTrkcandEta
Definition: IsoTrig.h:189
bool doMipCutTree
Definition: IsoTrig.h:124
edm::Service< TFileService > fs
Definition: IsoTrig.h:168
TTree * TimingTree
Definition: IsoTrig.h:169
double pLimits[6]
Definition: IsoTrig.h:136
TH1I * g_PreL1
Definition: IsoTrig.h:228
edm::ESHandle< MagneticField > bFieldH
Definition: IsoTrig.h:156
edm::EDGetTokenT< reco::VertexCollection > tok_verthe_
Definition: IsoTrig.h:148
TH1I * h_nL3Objs
Definition: IsoTrig.h:218
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
Definition: IsoTrig.h:147
~IsoTrig()
Definition: IsoTrig.cc:139
TH1D * h_dRL1[2]
Definition: IsoTrig.h:222
TH1D * h_etaCalibTracks[5][2][2]
Definition: IsoTrig.h:226
std::vector< bool > * t_TrkselTkFlag
Definition: IsoTrig.h:176
double cutMip
Definition: IsoTrig.h:134
std::string processName
Definition: IsoTrig.h:132
void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool)
Definition: IsoTrig.cc:1453
Definition: Run.h:41
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: IsoTrig.cc:742
TH1D * h_PreHLTwt
Definition: IsoTrig.h:220
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: IsoTrig.h:138
std::vector< double > pixelIsolationConeSizeAtEC_
Definition: IsoTrig.h:128
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: IsoTrig.cc:733
void pushChgIsolnTreeVecs(math::XYZTLorentzVector &Pixcand, math::XYZTLorentzVector &Trkcand, std::vector< double > &PixMaxP, double &TrkMaxP, bool &selTk)
Definition: IsoTrig.cc:403
TH1I * g_Accepts
Definition: IsoTrig.h:228
TH1D * h_eMip[2]
Definition: IsoTrig.h:224
std::vector< double > * t_NFcandPhi
Definition: IsoTrig.h:197