CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
IsoTrig Class Reference

#include <IsoTrig/IsoTrig/src/IsoTrig.cc>

Inheritance diagram for IsoTrig:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

double dR (double eta1, double eta2, double phi1, double phi2)
 
 IsoTrig (const edm::ParameterSet &)
 
 ~IsoTrig ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
double dEta (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
double dinvPt (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
double dP (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
double dPhi (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
double dPt (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
double dR (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
void fillCuts (int, double, double, double, math::XYZTLorentzVector &, int, bool)
 
void fillDifferences (int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
 
void fillHist (int, math::XYZTLorentzVector &)
 

Private Attributes

double a_charIsoR
 
double a_coneR
 
double a_mipR
 
double a_neutIsoR
 
double a_neutR1
 
double a_neutR2
 
bool changed
 
double cutCharge
 
double cutMip
 
double cutNeutral
 
std::string Det
 
double dr_L1
 
edm::Service< TFileServicefs
 
TH1I * g_Accepts
 
TH1I * g_Pre
 
TH1I * g_PreHLT
 
TH1I * g_PreL1
 
TH1D * h_dEta [6]
 
TH1D * h_dEtaL1 [2]
 
TH1D * h_dinvPt [6]
 
TH1D * h_dP [6]
 
TH1D * h_dPhi [6]
 
TH1D * h_dPhiL1 [2]
 
TH1D * h_dPt [6]
 
TH1D * h_dRL1 [2]
 
TH1D * h_eMaxNearP [2]
 
TH1D * h_eMip [2]
 
TH1D * h_eNeutIso [2]
 
TH1D * h_eta [20]
 
TH1D * h_etaCalibTracks [2][2]
 
TH1D * h_etaMipTracks [2][2]
 
TH1I * h_HLT
 
TH1D * h_L1ObjEnergy
 
TH1D * h_mindR [6]
 
TH1I * h_nHLT
 
TH1I * h_nL3Objs
 
TH1D * h_p [20]
 
TH1D * h_phi [20]
 
TH1I * h_Pre
 
TH1I * h_PreHLT
 
TH1D * h_PreHLTwt
 
TH1I * h_PreL1
 
TH1D * h_PreL1wt
 
TH1D * h_pt [20]
 
HLTConfigProvider hltConfig_
 
int maxRunNo
 
int minRunNo
 
spr::trackSelectionParameters selectionParameters
 
std::string theTrackQuality
 
std::map< unsigned int,
unsigned int > 
TrigList
 
std::map< unsigned int, const
std::pair< int, int > > 
TrigPreList
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

v Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 25 of file IsoTrig.h.

Constructor & Destructor Documentation

IsoTrig::IsoTrig ( const edm::ParameterSet iConfig)
explicit

Definition at line 58 of file IsoTrig.cc.

References a_charIsoR, a_coneR, a_mipR, a_neutIsoR, a_neutR1, a_neutR2, gather_cfg::cout, cutCharge, cutMip, cutNeutral, dr_L1, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, maxRunNo, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, minRunNo, reco::TrackBase::qualityByName(), selectionParameters, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality, and verbosity.

58  : changed(false) {
59  //now do whatever initialization is needed
60  Det = iConfig.getParameter<std::string>("Det");
61  verbosity = iConfig.getUntrackedParameter<int>("Verbosity",0);
62  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
64  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
65  selectionParameters.minQuality = trackQuality_;
66  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
67  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
68  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
69  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
70  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
71  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
72  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
73  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
74  dr_L1 = iConfig.getUntrackedParameter<double>("IsolationL1",1.0);
75  a_coneR = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
76  a_charIsoR = a_coneR + 28.9;
77  a_neutIsoR = a_charIsoR*0.726;
78  a_mipR = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
79  a_neutR1 = iConfig.getUntrackedParameter<double>("ConeRadiusNeut1",21.0);
80  a_neutR2 = iConfig.getUntrackedParameter<double>("ConeRadiusNeut2",29.0);
81  cutMip = iConfig.getUntrackedParameter<double>("MIPCut", 1.0);
82  cutCharge = iConfig.getUntrackedParameter<double>("ChargeIsolation", 2.0);
83  cutNeutral = iConfig.getUntrackedParameter<double>("NeutralIsolation", 2.0);
84  minRunNo = iConfig.getUntrackedParameter<int>("minRun");
85  maxRunNo = iConfig.getUntrackedParameter<int>("maxRun");
86  if (verbosity>=0) {
87  std::cout <<"Parameters read from config file \n"
88  <<"\t minPt " << selectionParameters.minPt
89  <<"\t theTrackQuality " << theTrackQuality
90  <<"\t minQuality " << selectionParameters.minQuality
91  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
92  <<"\t maxDzPV " << selectionParameters.maxDzPV
93  <<"\t maxChi2 " << selectionParameters.maxChi2
94  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
95  <<"\t minOuterHit " << selectionParameters.minOuterHit
96  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
97  <<"\t maxInMiss " << selectionParameters.maxInMiss
98  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
99  <<"\t a_coneR " << a_coneR
100  <<"\t a_charIsoR " << a_charIsoR
101  <<"\t a_neutIsoR " << a_neutIsoR
102  <<"\t a_mipR " << a_mipR
103  <<"\t a_neutR " << a_neutR1 << ":" << a_neutR2
104  <<"\t cuts (MIP " << cutMip << " : Charge " << cutCharge
105  <<" : Neutral " << cutNeutral << ")"
106  << std::endl;
107  }
108 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double a_coneR
Definition: IsoTrig.h:60
double dr_L1
Definition: IsoTrig.h:60
TrackQuality
track quality
Definition: TrackBase.h:95
std::string theTrackQuality
Definition: IsoTrig.h:59
bool changed
Definition: IsoTrig.h:65
double a_neutIsoR
Definition: IsoTrig.h:60
int maxRunNo
Definition: IsoTrig.h:62
int verbosity
Definition: IsoTrig.h:57
double a_mipR
Definition: IsoTrig.h:60
double cutNeutral
Definition: IsoTrig.h:61
double a_charIsoR
Definition: IsoTrig.h:60
double cutCharge
Definition: IsoTrig.h:61
double a_neutR2
Definition: IsoTrig.h:61
int minRunNo
Definition: IsoTrig.h:62
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
spr::trackSelectionParameters selectionParameters
Definition: IsoTrig.h:58
double a_neutR1
Definition: IsoTrig.h:61
reco::TrackBase::TrackQuality minQuality
tuple cout
Definition: gather_cfg.py:121
double cutMip
Definition: IsoTrig.h:61
IsoTrig::~IsoTrig ( )

Definition at line 110 of file IsoTrig.cc.

110  {
111  // do anything here that needs to be done at desctruction time
112  // (e.g. close files, deallocate resources etc.)
113 
114 }

Member Function Documentation

void IsoTrig::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 116 of file IsoTrig.cc.

References a_charIsoR, a_mipR, a_neutR1, a_neutR2, abs, ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), changed, spr::chargeIsolationCone(), gather_cfg::cout, cutCharge, cutMip, cutNeutral, deltaR(), dEta(), reco::dp, dPhi(), dR(), dr_L1, reco::e1, reco::e2, spr::eCone_ecal(), trigger::TriggerObject::energy(), trigger::TriggerObject::eta(), edm::EventID::event(), HcalObjRepresent::Fill(), fillCuts(), fillDifferences(), fillHist(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::filterTag(), spr::find(), edm::EventSetup::get(), edm::LuminosityBlock::getByLabel(), edm::Event::getByLabel(), edm::Event::getLuminosityBlock(), trigger::TriggerEvent::getObjects(), spr::goodTrack(), h_dEtaL1, h_dPhiL1, h_dRL1, h_HLT, h_L1ObjEnergy, h_nHLT, h_nL3Objs, h_Pre, h_PreHLT, h_PreHLTwt, h_PreL1, h_PreL1wt, runregparse::hlt, hltConfig_, i, edm::EventBase::id(), trigger::TriggerObject::id(), HcalDetId::ieta(), edm::HandleBase::isValid(), j, gen::k, LumiDetails::kOCC1, edm::InputTag::label(), diffTwoXMLs::label, edm::EventBase::luminosityBlock(), lumiProducer_cfi::lumiProducer, trigger::TriggerObject::mass(), HLTConfigProvider::moduleLabels(), n, reco::TrackBase::p(), trigger::TriggerObject::phi(), makeHLTPrescaleTable::prescales, HLTConfigProvider::prescaleValues(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), spr::propagateCALO(), trigger::TriggerObject::pt(), trigger::TriggerObject::px(), reco::TrackBase::px(), trigger::TriggerObject::py(), reco::TrackBase::py(), trigger::TriggerObject::pz(), reco::TrackBase::pz(), edm::EventID::run(), selectionParameters, HLTConfigProvider::size(), findQualityFiles::size, trigger::TriggerEvent::sizeFilters(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality, HLTConfigProvider::triggerIndex(), edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), patRefSel_triggerSelection_cff::triggerResults, TrigList, TrigPreList, verbosity, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

116  {
117 
118  if (verbosity%10 > 0) std::cout << "Event starts====================================" << std::endl;
119  int RunNo = iEvent.id().run();
120  int EvtNo = iEvent.id().event();
121  int Lumi = iEvent.luminosityBlock();
122  int Bunch = iEvent.bunchCrossing();
123 
125  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
126  const MagneticField *bField = bFieldH.product();
127 
128  // get handles to calogeometry and calotopology
130  iSetup.get<CaloGeometryRecord>().get(pG);
131  const CaloGeometry* geo = pG.product();
132 
134  iEvent.getByLabel("generalTracks", trkCollection);
135  reco::TrackCollection::const_iterator trkItr;
136 
137  edm::InputTag lumiProducer("LumiProducer", "", "RECO");
139  iEvent.getLuminosityBlock().getByLabel("lumiProducer",Lumid);
140  float mybxlumi=-1;
141  if (Lumid.isValid())
142  mybxlumi=Lumid->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
143  if (verbosity%10 > 0)
144  std::cout << "RunNo " << RunNo << " EvtNo " << EvtNo << " Lumi " << Lumi
145  << " Bunch " << Bunch << " mybxlumi " << mybxlumi << std::endl;
146 
147  edm::InputTag triggerEvent_ ("hltTriggerSummaryAOD","","HLT");
148  trigger::TriggerEvent triggerEvent;
149  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
150  iEvent.getByLabel(triggerEvent_,triggerEventHandle);
151  if (!triggerEventHandle.isValid())
152  std::cout << "Error! Can't get the product "<< triggerEvent_.label() << std::endl;
153  else {
154  triggerEvent = *(triggerEventHandle.product());
155 
156  const trigger::TriggerObjectCollection& TOC(triggerEvent.getObjects());
158  edm::InputTag theTriggerResultsLabel ("TriggerResults","","HLT");
160  iEvent.getByLabel( theTriggerResultsLabel, triggerResults);
161  char TrigName[50];
162  sprintf(TrigName, "HLT_IsoTrack%s", Det.c_str());
163  if (triggerResults.isValid()) {
164  std::vector<std::string> modules;
165  h_nHLT->Fill(triggerResults->size());
166  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
167 
168  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
169  int hlt(-1), preL1(-1), preHLT(-1), prescale(-1);
170  for (unsigned int i=0; i<triggerResults->size(); i++) {
171  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[i]);
172  const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
173  if (triggerNames_[i].find(TrigName)!=std::string::npos) {
174  const std::pair<int,int> prescales(hltConfig_.prescaleValues(iEvent,iSetup,triggerNames_[i]));
175  hlt = triggerResults->accept(i);
176  preL1 = prescales.first;
177  preHLT = prescales.second;
178  prescale = preL1*preHLT;
179  if (verbosity%10 > 0)
180  std::cout << triggerNames_[i] << " accept " << hlt << " preL1 "
181  << preL1 << " preHLT " << preHLT << std::endl;
182  if (hlt>0) {
183  std::vector<math::XYZTLorentzVector> vec[3];
184  if (TrigList.find(RunNo) != TrigList.end() ) {
185  TrigList[RunNo] += 1;
186  } else {
187  TrigList.insert(std::pair<unsigned int, unsigned int>(RunNo,1));
188  TrigPreList.insert(std::pair<unsigned int, std::pair<int, int>>(RunNo,prescales));
189  }
190  //loop over all trigger filters in event (i.e. filters passed)
191  for (unsigned int ifilter=0; ifilter<triggerEvent.sizeFilters(); ++ifilter) {
192  std::vector<int> Keys;
193  std::string label = triggerEvent.filterTag(ifilter).label();
194  //loop over keys to objects passing this filter
195  for (unsigned int imodule=0; imodule<moduleLabels.size(); imodule++) {
196  if (label.find(moduleLabels[imodule]) != std::string::npos) {
197  if (verbosity%10 > 0) std::cout << "FILTERNAME " << label << std::endl;
198  for (unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) {
199  Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]);
200  const trigger::TriggerObject& TO(TOC[Keys[ifiltrKey]]);
201  math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy());
202  if(label.find("L2Filter") != std::string::npos) {
203  vec[1].push_back(v4);
204  } else if (label.find("L3Filter") != std::string::npos) {
205  vec[2].push_back(v4);
206  } else {
207  vec[0].push_back(v4);
208  h_L1ObjEnergy->Fill(TO.energy());
209  }
210  if (verbosity%10 > 0)
211  std::cout << "key " << ifiltrKey << " : pt " << TO.pt() << " eta " << TO.eta() << " phi " << TO.phi() << " mass " << TO.mass() << " Id " << TO.id() << std::endl;
212  }
213  }
214  }
215  }
216  h_nL3Objs -> Fill(vec[2].size());
217 
219  for (int j=0; j<3; j++) {
220  for (unsigned int k=0; k<vec[j].size(); k++) {
221  if (verbosity%10 > 0) std::cout << "vec[" << j << "][" << k << "] pt " << vec[j][k].pt() << " eta " << vec[j][k].eta() << " phi " << vec[j][k].phi() << std::endl;
222  fillHist(j, vec[j][k]);
223  }
224  }
225 
226  double deta, dphi, dr;
228  for (int lvl=1; lvl<3; lvl++) {
229  for (unsigned int i=0; i<vec[lvl].size(); i++) {
230  deta = dEta(vec[0][0],vec[lvl][i]);
231  dphi = dPhi(vec[0][0],vec[lvl][i]);
232  dr = dR(vec[0][0],vec[lvl][i]);
233  if (verbosity%10 > 0) std::cout << "lvl " <<lvl << " i " << i << " deta " << deta << " dphi " << dphi << " dR " << dr << std::endl;
234  h_dEtaL1[lvl-1] -> Fill(deta);
235  h_dPhiL1[lvl-1] -> Fill(dphi);
236  h_dRL1[lvl-1] -> Fill(std::sqrt(dr));
237  }
238  }
239 
240  math::XYZTLorentzVector mindRvec;
241  double mindR;
242  for (unsigned int k=0; k<vec[2].size(); ++k) {
244  mindR=999.9;
245  if (verbosity%10 > 0) std::cout << "L3obj: pt " << vec[2][i].pt() << " eta " << vec[2][i].eta() << " phi " << vec[2][i].phi() << std::endl;
246  for (unsigned int j=0; j<vec[1].size(); j++) {
247  dr = dR(vec[2][k],vec[1][j]);
248  if(dr<mindR) {
249  mindR=dr;
250  mindRvec=vec[1][j];
251  }
252  }
253  fillDifferences(0, vec[2][k], mindRvec, (verbosity%10 >0));
254  if(mindR < 0.03) {
255  fillDifferences(1, vec[2][k], mindRvec, (verbosity%10 >0));
256  fillHist(6, mindRvec);
257  fillHist(8, vec[2][k]);
258  } else {
259  fillDifferences(2, vec[2][k], mindRvec, (verbosity%10 >0));
260  fillHist(7, mindRvec);
261  fillHist(9, vec[2][k]);
262  }
263 
265  mindR=999.9;
266  if (verbosity%10 > 0) std::cout << "vec[2][k].eta() " << vec[2][k].eta() << " vec[k][0].phi " << vec[2][k].phi() << std::endl;
267  reco::TrackCollection::const_iterator goodTk = trkCollection->end();
268  if (trkCollection.isValid()) {
269  double mindP = 9999.9;
270  for (trkItr=trkCollection->begin();
271  trkItr!=trkCollection->end(); trkItr++) {
272  math::XYZTLorentzVector v4(trkItr->px(), trkItr->py(),
273  trkItr->pz(), trkItr->p());
274  double deltaR = dR(v4, vec[2][k]);
275  double dp = std::abs(v4.r()/vec[2][k].r()-1.0);
276  if (deltaR<mindR) {
277  mindR = deltaR;
278  mindP = dp;
279  mindRvec = v4;
280  goodTk = trkItr;
281  }
282  if ((verbosity/10)%10>1 && deltaR<1.0) {
283  std::cout << "track: pt " << v4.pt() << " eta " << v4.eta()
284  << " phi " << v4.phi() << " DR " << deltaR
285  << std::endl;
286  }
287  }
288  if (mindR < 0.03 && mindP > 0.1) {
289  for (trkItr=trkCollection->begin();
290  trkItr!=trkCollection->end(); trkItr++) {
291  math::XYZTLorentzVector v4(trkItr->px(), trkItr->py(),
292  trkItr->pz(), trkItr->p());
293  double deltaR = dR(v4, vec[2][k]);
294  double dp = std::abs(v4.r()/vec[2][k].r()-1.0);
295  if (dp<mindP && deltaR<0.03) {
296  mindR = deltaR;
297  mindP = dp;
298  mindRvec = v4;
299  goodTk = trkItr;
300  }
301  }
302  }
303  fillDifferences(3, vec[2][k], mindRvec, (verbosity%10 >0));
304  fillHist(3, mindRvec);
305  if(mindR < 0.03) {
306  fillDifferences(4, vec[2][k], mindRvec, (verbosity%10 >0));
307  fillHist(4, mindRvec);
308  } else {
309  fillDifferences(5, vec[2][k], mindRvec, (verbosity%10 >0));
310  fillHist(5, mindRvec);
311  }
312 
313  //Define the best vertex
315  iEvent.getByLabel("offlinePrimaryVertices",recVtxs);
316  // Get the beamspot
317  edm::Handle<reco::BeamSpot> beamSpotH;
318  iEvent.getByLabel("offlineBeamSpot", beamSpotH);
319  math::XYZPoint leadPV(0,0,0);
320  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
321  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
322  } else if (beamSpotH.isValid()) {
323  leadPV = beamSpotH->position();
324  }
325  if ((verbosity/100)%10>0) {
326  std::cout << "Primary Vertex " << leadPV;
327  if (beamSpotH.isValid()) std::cout << " Beam Spot "
328  << beamSpotH->position();
329  std::cout << std::endl;
330  }
331 
332  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
333  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDirections, ((verbosity/100)%10>2));
334  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
335 
336  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
337  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
338  iEvent.getByLabel("ecalRecHit","EcalRecHitsEB",barrelRecHitsHandle);
339  iEvent.getByLabel("ecalRecHit","EcalRecHitsEE",endcapRecHitsHandle);
340 
341  unsigned int nTracks=0, ngoodTk=0, nselTk=0;
342  int ieta=999;
343  for (trkDetItr = trkCaloDirections.begin(); trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
344  bool l3Track = (trkDetItr->trkItr == goodTk);
345  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
346  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
347  pTrack->pz(), pTrack->p());
348  bool selectTk = spr::goodTrack(pTrack,leadPV,selectionParameters,((verbosity/100)%10>2));
349  double eMipDR=9999., e_inCone=0, conehmaxNearP=0, mindR=999.9;
350  if (trkDetItr->okHCAL) {
351  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
352  ieta = detId.ieta();
353  }
354  for (unsigned k=0; k<vec[0].size(); ++k) {
355  double deltaR = dR(v4, vec[0][k]);
356  if (deltaR<mindR) mindR = deltaR;
357  }
358  if (selectTk && trkDetItr->okECAL && trkDetItr->okHCAL) {
359  ngoodTk++;
360  int nRH_eMipDR=0, nNearTRKs=0;
361  double e1 = spr::eCone_ecal(geo, barrelRecHitsHandle, endcapRecHitsHandle,
362  trkDetItr->pointHCAL, trkDetItr->pointECAL,
363  a_neutR1, trkDetItr->directionECAL, nRH_eMipDR);
364  double e2 = spr::eCone_ecal(geo, barrelRecHitsHandle, endcapRecHitsHandle,
365  trkDetItr->pointHCAL, trkDetItr->pointECAL,
366  a_neutR2, trkDetItr->directionECAL, nRH_eMipDR);
367  eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle, endcapRecHitsHandle,
368  trkDetItr->pointHCAL, trkDetItr->pointECAL,
369  a_mipR, trkDetItr->directionECAL, nRH_eMipDR);
370  conehmaxNearP = spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR, nNearTRKs, ((verbosity/100)%10>2));
371  e_inCone = e2 - e1;
372  if (eMipDR<1.0) nselTk++;
373  }
374  if (l3Track) {
375  fillHist(10,v4);
376  if (selectTk) {
377  fillHist(11,v4);
378  fillCuts(0, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR>dr_L1));
379  if (conehmaxNearP < cutCharge) {
380  fillHist(12,v4);
381  if (eMipDR < cutMip) {
382  fillHist(13,v4);
383  if (e_inCone < cutNeutral) fillHist(14, v4);
384  }
385  }
386  }
387  } else {
388  fillHist(15,v4);
389  if (selectTk) {
390  fillHist(16,v4);
391  fillCuts(1, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR>dr_L1));
392  if (conehmaxNearP < cutCharge) {
393  fillHist(17,v4);
394  if (eMipDR < cutMip) {
395  fillHist(18,v4);
396  if (e_inCone < cutNeutral) fillHist(19, v4);
397  }
398  }
399  }
400  }
401  }
402  }
403  }
404  }
405  break;
406  }
407  }
408 
409  h_HLT -> Fill(hlt);
410  h_PreL1 -> Fill(preL1);
411  h_PreHLT -> Fill(preHLT);
412  h_Pre -> Fill(prescale);
413  h_PreL1wt -> Fill(preL1, mybxlumi);
414  h_PreHLTwt -> Fill(preHLT, mybxlumi);
415 
416  // check if trigger names in (new) config
417  if (changed) {
418  changed = false;
419  if ((verbosity/10)%10 > 1) {
420  std::cout<<"New trigger menu found !!!" << std::endl;
421  const unsigned int n(hltConfig_.size());
422  for (unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
423  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[itrig]);
424  std::cout << triggerNames_[itrig] << " " << triggerindx << " ";
425  if (triggerindx >= n)
426  std::cout << "does not exist in the current menu" << std::endl;
427  else
428  std::cout << "exists" << std::endl;
429  }
430  }
431  }
432  }
433  }
434 }
RunNumber_t run() const
Definition: EventID.h:42
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:207
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:27
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:137
double dr_L1
Definition: IsoTrig.h:60
TH1I * h_Pre
Definition: IsoTrig.h:67
TH1D * h_dEtaL1[2]
Definition: IsoTrig.h:70
std::string theTrackQuality
Definition: IsoTrig.h:59
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:113
int bunchCrossing() const
Definition: EventBase.h:62
bool changed
Definition: IsoTrig.h:65
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:133
TH1I * h_HLT
Definition: IsoTrig.h:67
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
float float float z
HLTConfigProvider hltConfig_
Definition: IsoTrig.h:55
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
TH1D * h_dPhiL1[2]
Definition: IsoTrig.h:70
TH1D * h_L1ObjEnergy
Definition: IsoTrig.h:68
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
int verbosity
Definition: IsoTrig.h:57
void fillHist(int, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:599
TH1I * h_nHLT
Definition: IsoTrig.h:67
double a_mipR
Definition: IsoTrig.h:60
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:100
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:48
double cutNeutral
Definition: IsoTrig.h:61
TH1I * h_PreHLT
Definition: IsoTrig.h:67
double a_charIsoR
Definition: IsoTrig.h:60
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
double cutCharge
Definition: IsoTrig.h:61
int j
Definition: DBlmapReader.cc:9
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:68
bool isValid() const
Definition: HandleBase.h:76
double a_neutR2
Definition: IsoTrig.h:61
TH1D * h_PreL1wt
Definition: IsoTrig.h:68
std::map< unsigned int, const std::pair< int, int > > TrigPreList
Definition: IsoTrig.h:64
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:642
double dR(double eta1, double eta2, double phi1, double phi2)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:137
int k[5][pyjets_maxn]
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
TH1I * h_PreL1
Definition: IsoTrig.h:67
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
Float e1
Definition: deltaR.h:22
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:105
auto dp
Definition: deltaR.h:24
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< size_type > Keys
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:638
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::pair< int, int > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger) const
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
T const * product() const
Definition: Handle.h:74
spr::trackSelectionParameters selectionParameters
Definition: IsoTrig.h:58
Float e2
Definition: deltaR.h:23
std::map< unsigned int, unsigned int > TrigList
Definition: IsoTrig.h:63
std::string const & label() const
Definition: InputTag.h:42
edm::EventID id() const
Definition: EventBase.h:56
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500)
double a_neutR1
Definition: IsoTrig.h:61
void fillDifferences(int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
Definition: IsoTrig.cc:606
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
TH1I * h_nL3Objs
Definition: IsoTrig.h:67
TH1D * h_dRL1[2]
Definition: IsoTrig.h:70
double cutMip
Definition: IsoTrig.h:61
tuple size
Write out results.
void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool)
Definition: IsoTrig.cc:624
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:135
TH1D * h_PreHLTwt
Definition: IsoTrig.h:68
void IsoTrig::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 436 of file IsoTrig.cc.

References hpstanc_transforms::cuts, fs, h_dEta, h_dEtaL1, h_dinvPt, h_dP, h_dPhi, h_dPhiL1, h_dPt, h_dRL1, h_eMaxNearP, h_eMip, h_eNeutIso, h_eta, h_etaCalibTracks, h_etaMipTracks, h_HLT, h_L1ObjEnergy, h_mindR, h_nHLT, h_nL3Objs, h_p, h_phi, h_Pre, h_PreHLT, h_PreHLTwt, h_PreL1, h_PreL1wt, h_pt, TFileDirectory::make(), and AlCaHLTBitMon_QueryRunRegistry::string.

436  {
437  char hname[100], htit[100];
438  std::string levels[20] = {"L1", "L2", "L3",
439  "Reco", "RecoMatch", "RecoNoMatch",
440  "L2Match", "L2NoMatch", "L3Match", "L3NoMatch",
441  "HLTTrk", "HLTGoodTrk", "HLTIsoTrk", "HLTMip", "HLTSelect",
442  "nonHLTTrk", "nonHLTGoodTrk", "nonHLTIsoTrk", "nonHLTMip", "nonHLTSelect"};
443  std::string pairs[6] = {"L2L3", "L2L3Match", "L2L3NoMatch", "L3Reco", "L3RecoMatch", "L3RecoNoMatch"};
444 
445  std::string cuts[2] = {"HLTMatched", "HLTNotMatched"};
446  std::string cuts2[2] = {"All", "Away from L1"};
447  h_nHLT = fs->make<TH1I>("h_nHLT" , "size of rigger Names", 1000, 1, 1000);
448  h_HLT = fs->make<TH1I>("h_HLT" , "HLT accept", 3, -1, 2);
449  h_PreL1 = fs->make<TH1I>("h_PreL1", "L1 Prescale", 500, 0, 500);
450  h_PreHLT = fs->make<TH1I>("h_PreHLT", "HLT Prescale", 50, 0, 50);
451  h_Pre = fs->make<TH1I>("h_Pre", "Prescale", 3000, 0, 3000);
452  h_nL3Objs = fs->make<TH1I>("h_nL3Objs", "Number of L3 objects", 10, 0, 10);
453 
454  h_PreL1wt = fs->make<TH1D>("h_PreL1wt", "Weighted L1 Prescale", 500, 0, 500);
455  h_PreHLTwt = fs->make<TH1D>("h_PreHLTwt", "Weighted HLT Prescale", 500, 0, 100);
456  h_L1ObjEnergy = fs->make<TH1D>("h_L1ObjEnergy", "Energy of L1Object", 500, 0.0, 500.0);
457 
458  for(int ipair=0; ipair<6; ipair++) {
459  sprintf(hname, "h_dEta%s", pairs[ipair].c_str());
460  sprintf(htit, "dEta for %s", pairs[ipair].c_str());
461  h_dEta[ipair] = fs->make<TH1D>(hname, htit, 200, -10.0, 10.0);
462  h_dEta[ipair]->GetXaxis()->SetTitle("d#eta");
463 
464  sprintf(hname, "h_dPhi%s", pairs[ipair].c_str());
465  sprintf(htit, "dPhi for %s", pairs[ipair].c_str());
466  h_dPhi[ipair] = fs->make<TH1D>(hname, htit, 140, -7.0, 7.0);
467  h_dPhi[ipair]->GetXaxis()->SetTitle("d#phi");
468 
469  sprintf(hname, "h_dPt%s", pairs[ipair].c_str());
470  sprintf(htit, "dPt for %s objects", pairs[ipair].c_str());
471  h_dPt[ipair] = fs->make<TH1D>(hname, htit, 400, -200.0, 200.0);
472  h_dPt[ipair]->GetXaxis()->SetTitle("dp_{T} (GeV)");
473 
474  sprintf(hname, "h_dP%s", pairs[ipair].c_str());
475  sprintf(htit, "dP for %s objects", pairs[ipair].c_str());
476  h_dP[ipair] = fs->make<TH1D>(hname, htit, 400, -200.0, 200.0);
477  h_dP[ipair]->GetXaxis()->SetTitle("dP (GeV)");
478 
479  sprintf(hname, "h_dinvPt%s", pairs[ipair].c_str());
480  sprintf(htit, "dinvPt for %s objects", pairs[ipair].c_str());
481  h_dinvPt[ipair] = fs->make<TH1D>(hname, htit, 500, -0.4, 0.1);
482  h_dinvPt[ipair]->GetXaxis()->SetTitle("d(1/p_{T})");
483 
484  sprintf(hname, "h_mindR%s", pairs[ipair].c_str());
485  sprintf(htit, "mindR for %s objects", pairs[ipair].c_str());
486  h_mindR[ipair] = fs->make<TH1D>(hname, htit, 500, 0.0, 1.0);
487  h_mindR[ipair]->GetXaxis()->SetTitle("dR");
488  }
489 
490  for(int ilevel=0; ilevel<20; ilevel++) {
491  sprintf(hname, "h_p%s", levels[ilevel].c_str());
492  sprintf(htit, "p for %s objects", levels[ilevel].c_str());
493  h_p[ilevel] = fs->make<TH1D>(hname, htit, 100, 0.0, 500.0);
494  h_p[ilevel]->GetXaxis()->SetTitle("p (GeV)");
495 
496  sprintf(hname, "h_pt%s", levels[ilevel].c_str());
497  sprintf(htit, "pt for %s objects", levels[ilevel].c_str());
498  h_pt[ilevel] = fs->make<TH1D>(hname, htit, 100, 0.0, 500.0);
499  h_pt[ilevel]->GetXaxis()->SetTitle("p_{T} (GeV)");
500 
501  sprintf(hname, "h_eta%s", levels[ilevel].c_str());
502  sprintf(htit, "eta for %s objects", levels[ilevel].c_str());
503  h_eta[ilevel] = fs->make<TH1D>(hname, htit, 100, -5.0, 5.0);
504  h_eta[ilevel]->GetXaxis()->SetTitle("#eta");
505 
506  sprintf(hname, "h_phi%s", levels[ilevel].c_str());
507  sprintf(htit, "phi for %s objects", levels[ilevel].c_str());
508  h_phi[ilevel] = fs->make<TH1D>(hname, htit, 70, -3.5, 3.50);
509  h_phi[ilevel]->GetXaxis()->SetTitle("#phi");
510  }
511  for(int lvl=0; lvl<2; lvl++) {
512  sprintf(hname, "h_dEtaL1%s", levels[lvl+1].c_str());
513  sprintf(htit, "dEta for L1 and %s objects", levels[lvl+1].c_str());
514  h_dEtaL1[lvl] = fs->make<TH1D>(hname, htit, 400, -10.0, 10.0);
515 
516  sprintf(hname, "h_dPhiL1%s", levels[lvl+1].c_str());
517  sprintf(htit, "dPhi for L1 and %s objects", levels[lvl+1].c_str());
518  h_dPhiL1[lvl] = fs->make<TH1D>(hname, htit, 280, -7.0, 7.0);
519 
520  sprintf(hname, "h_dRL1%s", levels[lvl+1].c_str());
521  sprintf(htit, "dR for L1 and %s objects", levels[lvl+1].c_str());
522  h_dRL1[lvl] = fs->make<TH1D>(hname, htit, 100, 0.0, 10.0);
523  }
524 
525  for(int icut=0; icut<2; icut++) {
526  sprintf(hname, "h_eMip%s", cuts[icut].c_str());
527  sprintf(htit, "eMip for %s tracks", cuts[icut].c_str());
528  h_eMip[icut] =fs->make<TH1D>(hname, htit, 200, 0.0, 10.0);
529  h_eMip[icut]->GetXaxis()->SetTitle("E_{Mip} (GeV)");
530 
531  sprintf(hname, "h_eMaxNearP%s", cuts[icut].c_str());
532  sprintf(htit, "eMaxNearP for %s tracks", cuts[icut].c_str());
533  h_eMaxNearP[icut]=fs->make<TH1D>(hname, htit, 240, -2.0, 10.0);
534  h_eMaxNearP[icut]->GetXaxis()->SetTitle("E_{MaxNearP} (GeV)");
535 
536  sprintf(hname, "h_eNeutIso%s", cuts[icut].c_str());
537  sprintf(htit, "eNeutIso for %s ", cuts[icut].c_str());
538  h_eNeutIso[icut] =fs->make<TH1D>(hname, htit, 200, 0.0, 10.0);
539  h_eNeutIso[icut]->GetXaxis()->SetTitle("E_{NeutIso} (GeV)");
540 
541  for (int kcut=0; kcut<2; ++kcut) {
542  sprintf(hname, "h_etaCalibTracks%s%d", cuts[icut].c_str(), kcut);
543  sprintf(htit, "etaCalibTracks for %s (%s)", cuts[icut].c_str(), cuts2[kcut].c_str());
544  h_etaCalibTracks[icut][kcut]=fs->make<TH1D>(hname, htit, 60, -30.0, 30.0);
545  h_etaCalibTracks[icut][kcut]->GetXaxis()->SetTitle("i#eta");
546 
547  sprintf(hname, "h_etaMipTracks%s%d", cuts[icut].c_str(), kcut);
548  sprintf(htit, "etaMipTracks for %s (%s)", cuts[icut].c_str(), cuts2[kcut].c_str());
549  h_etaMipTracks[icut][kcut]=fs->make<TH1D>(hname, htit, 60, -30.0, 30.0);
550  h_etaMipTracks[icut][kcut]->GetXaxis()->SetTitle("i#eta");
551  }
552  }
553 }
TH1D * h_dPt[6]
Definition: IsoTrig.h:71
TH1D * h_phi[20]
Definition: IsoTrig.h:69
TH1D * h_dP[6]
Definition: IsoTrig.h:71
TH1D * h_dEta[6]
Definition: IsoTrig.h:71
TH1I * h_Pre
Definition: IsoTrig.h:67
TH1D * h_dEtaL1[2]
Definition: IsoTrig.h:70
TH1D * h_eMaxNearP[2]
Definition: IsoTrig.h:72
TH1I * h_HLT
Definition: IsoTrig.h:67
TH1D * h_etaMipTracks[2][2]
Definition: IsoTrig.h:70
TH1D * h_dPhi[6]
Definition: IsoTrig.h:71
TH1D * h_dPhiL1[2]
Definition: IsoTrig.h:70
TH1D * h_L1ObjEnergy
Definition: IsoTrig.h:68
TH1D * h_etaCalibTracks[2][2]
Definition: IsoTrig.h:72
TH1I * h_nHLT
Definition: IsoTrig.h:67
TH1D * h_dinvPt[6]
Definition: IsoTrig.h:71
TH1I * h_PreHLT
Definition: IsoTrig.h:67
TH1D * h_eMip[2]
Definition: IsoTrig.h:72
TH1D * h_eta[20]
Definition: IsoTrig.h:69
TH1D * h_PreL1wt
Definition: IsoTrig.h:68
TH1D * h_p[20]
Definition: IsoTrig.h:69
TH1D * h_eNeutIso[2]
Definition: IsoTrig.h:72
TH1I * h_PreL1
Definition: IsoTrig.h:67
TH1D * h_pt[20]
Definition: IsoTrig.h:69
T * make() const
make new ROOT object
edm::Service< TFileService > fs
Definition: IsoTrig.h:66
TH1I * h_nL3Objs
Definition: IsoTrig.h:67
TH1D * h_dRL1[2]
Definition: IsoTrig.h:70
TH1D * h_mindR[6]
Definition: IsoTrig.h:71
TH1D * h_PreHLTwt
Definition: IsoTrig.h:68
void IsoTrig::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 587 of file IsoTrig.cc.

587 {}
void IsoTrig::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 578 of file IsoTrig.cc.

References changed, gather_cfg::cout, hltConfig_, HLTConfigProvider::init(), and edm::RunBase::run().

578  {
579  std::cout << "Run " << iRun.run() << " hltconfig.init "
580  << hltConfig_.init(iRun,iSetup,"HLT",changed) << std::endl;;
581 }
bool changed
Definition: IsoTrig.h:65
HLTConfigProvider hltConfig_
Definition: IsoTrig.h:55
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
tuple cout
Definition: gather_cfg.py:121
double IsoTrig::dEta ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 638 of file IsoTrig.cc.

Referenced by analyze(), dR(), and fillDifferences().

638  {
639  return (vec1.eta()-vec2.eta());
640 }
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double IsoTrig::dinvPt ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 668 of file IsoTrig.cc.

Referenced by fillDifferences().

668  {
669  return ((1/vec1.pt())-(1/vec2.pt()));
670 }
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double IsoTrig::dP ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 664 of file IsoTrig.cc.

References abs.

Referenced by fillDifferences().

664  {
665  return (std::abs(vec1.r()-vec2.r()));
666 }
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double IsoTrig::dPhi ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 642 of file IsoTrig.cc.

References M_PI.

Referenced by analyze(), dR(), and fillDifferences().

642  {
643 
644  double phi1 = vec1.phi();
645  if (phi1 < 0) phi1 += 2.0*M_PI;
646  double phi2 = vec2.phi();
647  if (phi2 < 0) phi2 += 2.0*M_PI;
648  double dphi = phi1-phi2;
649  if (dphi > M_PI) dphi -= 2.*M_PI;
650  else if (dphi < -M_PI) dphi += 2.*M_PI;
651  return dphi;
652 }
std::vector< double > vec1
Definition: HCALResponse.h:15
#define M_PI
Definition: BFit3D.cc:3
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double IsoTrig::dPt ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 660 of file IsoTrig.cc.

Referenced by fillDifferences().

660  {
661  return (vec1.pt()-vec2.pt());
662 }
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double IsoTrig::dR ( double  eta1,
double  eta2,
double  phi1,
double  phi2 
)

Referenced by analyze(), and fillDifferences().

double IsoTrig::dR ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 654 of file IsoTrig.cc.

References dEta(), dPhi(), and mathSSE::sqrt().

654  {
655  double deta = dEta(vec1,vec2);
656  double dphi = dPhi(vec1,vec2);
657  return std::sqrt(deta*deta + dphi*dphi);
658 }
std::vector< double > vec1
Definition: HCALResponse.h:15
T sqrt(T t)
Definition: SSEVec.h:48
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:642
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:638
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
void IsoTrig::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 555 of file IsoTrig.cc.

References gather_cfg::cout, first, fs, g_Accepts, g_Pre, g_PreHLT, g_PreL1, TFileDirectory::make(), maxRunNo, minRunNo, n, edm::second(), TrigList, and TrigPreList.

555  {
556  unsigned int preL1, preHLT;
557  std::map<unsigned int, unsigned int>::iterator itr;
558  std::map<unsigned int, const std::pair<int, int>>::iterator itrPre;
559  std::cout << "RunNo vs HLT accepts for " << Det << std::endl;
560  unsigned int n = maxRunNo - minRunNo +1;
561  g_Pre = fs->make<TH1I>("h_PrevsRN", "PreScale Vs Run Number", n, minRunNo, maxRunNo);
562  g_PreL1 = fs->make<TH1I>("h_PreL1vsRN", "L1 PreScale Vs Run Number", n, minRunNo, maxRunNo);
563  g_PreHLT = fs->make<TH1I>("h_PreHLTvsRN", "HLT PreScale Vs Run Number", n, minRunNo, maxRunNo);
564  g_Accepts = fs->make<TH1I>("h_HLTAcceptsvsRN", "HLT Accepts Vs Run Number", n, minRunNo, maxRunNo);
565 
566  for (itr=TrigList.begin(), itrPre=TrigPreList.begin(); itr!=TrigList.end(); itr++, itrPre++) {
567  preL1 = (itrPre->second).first;
568  preHLT = (itrPre->second).second;
569  std::cout << itr->first << " " << itr->second << " " << itrPre->first << " " << preL1 << " " << preHLT << std::endl;
570  g_Accepts->Fill(itr->first, itr->second);
571  g_PreL1->Fill(itr->first, preL1);
572  g_PreHLT->Fill(itr->first, preHLT);
573  g_Pre->Fill(itr->first, preL1*preHLT);
574  }
575 }
TH1I * g_PreHLT
Definition: IsoTrig.h:73
U second(std::pair< T, U > const &p)
int maxRunNo
Definition: IsoTrig.h:62
bool first
Definition: L1TdeRCT.cc:94
std::map< unsigned int, const std::pair< int, int > > TrigPreList
Definition: IsoTrig.h:64
int minRunNo
Definition: IsoTrig.h:62
TH1I * g_Pre
Definition: IsoTrig.h:73
std::map< unsigned int, unsigned int > TrigList
Definition: IsoTrig.h:63
T * make() const
make new ROOT object
tuple cout
Definition: gather_cfg.py:121
edm::Service< TFileService > fs
Definition: IsoTrig.h:66
TH1I * g_PreL1
Definition: IsoTrig.h:73
TH1I * g_Accepts
Definition: IsoTrig.h:73
void IsoTrig::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 589 of file IsoTrig.cc.

589 {}
void IsoTrig::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 584 of file IsoTrig.cc.

584 {}
void IsoTrig::fillCuts ( int  indx,
double  eMipDR,
double  conehmaxNearP,
double  e_inCone,
math::XYZTLorentzVector vec,
int  ieta,
bool  cut 
)
private

Definition at line 624 of file IsoTrig.cc.

References cutCharge, cutMip, cutNeutral, h_eMaxNearP, h_eMip, h_eNeutIso, h_etaCalibTracks, and h_etaMipTracks.

Referenced by analyze().

624  {
625  h_eMip[indx] ->Fill(eMipDR);
626  h_eMaxNearP[indx]->Fill(conehmaxNearP);
627  h_eNeutIso[indx] ->Fill(e_inCone);
628  if (conehmaxNearP < cutCharge && eMipDR < cutMip && vec.r()<60 && vec.r()>40) {
629  h_etaMipTracks[indx][0]->Fill((double)(ieta));
630  if (cut) h_etaMipTracks[indx][1]->Fill((double)(ieta));
631  if (e_inCone < cutNeutral) {
632  h_etaCalibTracks[indx][0]->Fill((double)(ieta));
633  if (cut) h_etaCalibTracks[indx][1]->Fill((double)(ieta));
634  }
635  }
636 }
TH1D * h_eMaxNearP[2]
Definition: IsoTrig.h:72
TH1D * h_etaMipTracks[2][2]
Definition: IsoTrig.h:70
TH1D * h_etaCalibTracks[2][2]
Definition: IsoTrig.h:72
double cutNeutral
Definition: IsoTrig.h:61
TH1D * h_eMip[2]
Definition: IsoTrig.h:72
double cutCharge
Definition: IsoTrig.h:61
TH1D * h_eNeutIso[2]
Definition: IsoTrig.h:72
double cutMip
Definition: IsoTrig.h:61
void IsoTrig::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 591 of file IsoTrig.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

591  {
592  //The following says we do not know what parameters are allowed so do no validation
593  // Please change this to state exactly what you do use, even if it is no parameters
595  desc.setUnknown();
596  descriptions.addDefault(desc);
597 }
void addDefault(ParameterSetDescription const &psetDescription)
void IsoTrig::fillDifferences ( int  indx,
math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2,
bool  debug 
)
private

Definition at line 606 of file IsoTrig.cc.

References gather_cfg::cout, dEta(), dinvPt(), reco::dp, dP(), dPhi(), dPt(), dR(), h_dEta, h_dinvPt, h_dP, h_dPhi, h_dPt, and h_mindR.

Referenced by analyze().

607  {
608  double dr = dR(vec1,vec2);
609  double deta = dEta(vec1, vec2);
610  double dphi = dPhi(vec1, vec2);
611  double dpt = dPt(vec1, vec2);
612  double dp = dP(vec1, vec2);
613  double dinvpt = dinvPt(vec1, vec2);
614  h_dEta[indx] ->Fill(deta);
615  h_dPhi[indx] ->Fill(dphi);
616  h_dPt[indx] ->Fill(dpt);
617  h_dP[indx] ->Fill(dp);
618  h_dinvPt[indx]->Fill(dinvpt);
619  h_mindR[indx] ->Fill(dr);
620  if (debug) std::cout << "mindR for index " << indx << " is " << dr << " deta " << deta
621  << " dphi " << dphi << " dpt " << dpt << " dinvpt " << dinvpt <<std::endl;
622 }
TH1D * h_dPt[6]
Definition: IsoTrig.h:71
TH1D * h_dP[6]
Definition: IsoTrig.h:71
TH1D * h_dEta[6]
Definition: IsoTrig.h:71
double dP(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:664
TH1D * h_dPhi[6]
Definition: IsoTrig.h:71
double dinvPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:668
TH1D * h_dinvPt[6]
Definition: IsoTrig.h:71
std::vector< double > vec1
Definition: HCALResponse.h:15
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:642
double dR(double eta1, double eta2, double phi1, double phi2)
auto dp
Definition: deltaR.h:24
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:638
double dPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:660
tuple cout
Definition: gather_cfg.py:121
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
TH1D * h_mindR[6]
Definition: IsoTrig.h:71
void IsoTrig::fillHist ( int  indx,
math::XYZTLorentzVector vec 
)
private

Definition at line 599 of file IsoTrig.cc.

References h_eta, h_p, h_phi, and h_pt.

Referenced by analyze().

599  {
600  h_p[indx]->Fill(vec.r());
601  h_pt[indx]->Fill(vec.pt());
602  h_eta[indx]->Fill(vec.eta());
603  h_phi[indx]->Fill(vec.phi());
604 }
TH1D * h_phi[20]
Definition: IsoTrig.h:69
TH1D * h_eta[20]
Definition: IsoTrig.h:69
TH1D * h_p[20]
Definition: IsoTrig.h:69
TH1D * h_pt[20]
Definition: IsoTrig.h:69

Member Data Documentation

double IsoTrig::a_charIsoR
private

Definition at line 60 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

double IsoTrig::a_coneR
private

Definition at line 60 of file IsoTrig.h.

Referenced by IsoTrig().

double IsoTrig::a_mipR
private

Definition at line 60 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

double IsoTrig::a_neutIsoR
private

Definition at line 60 of file IsoTrig.h.

Referenced by IsoTrig().

double IsoTrig::a_neutR1
private

Definition at line 61 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

double IsoTrig::a_neutR2
private

Definition at line 61 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

bool IsoTrig::changed
private

Definition at line 65 of file IsoTrig.h.

Referenced by analyze(), and beginRun().

double IsoTrig::cutCharge
private

Definition at line 61 of file IsoTrig.h.

Referenced by analyze(), fillCuts(), and IsoTrig().

double IsoTrig::cutMip
private

Definition at line 61 of file IsoTrig.h.

Referenced by analyze(), fillCuts(), and IsoTrig().

double IsoTrig::cutNeutral
private

Definition at line 61 of file IsoTrig.h.

Referenced by analyze(), fillCuts(), and IsoTrig().

std::string IsoTrig::Det
private

Definition at line 56 of file IsoTrig.h.

double IsoTrig::dr_L1
private

Definition at line 60 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

edm::Service<TFileService> IsoTrig::fs
private

Definition at line 66 of file IsoTrig.h.

Referenced by beginJob(), and endJob().

TH1I * IsoTrig::g_Accepts
private

Definition at line 73 of file IsoTrig.h.

Referenced by endJob().

TH1I* IsoTrig::g_Pre
private

Definition at line 73 of file IsoTrig.h.

Referenced by endJob().

TH1I * IsoTrig::g_PreHLT
private

Definition at line 73 of file IsoTrig.h.

Referenced by endJob().

TH1I * IsoTrig::g_PreL1
private

Definition at line 73 of file IsoTrig.h.

Referenced by endJob().

TH1D* IsoTrig::h_dEta[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1D* IsoTrig::h_dEtaL1[2]
private

Definition at line 70 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_dinvPt[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1D * IsoTrig::h_dP[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1D * IsoTrig::h_dPhi[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1D * IsoTrig::h_dPhiL1[2]
private

Definition at line 70 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_dPt[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1D * IsoTrig::h_dRL1[2]
private

Definition at line 70 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_eMaxNearP[2]
private

Definition at line 72 of file IsoTrig.h.

Referenced by beginJob(), and fillCuts().

TH1D* IsoTrig::h_eMip[2]
private

Definition at line 72 of file IsoTrig.h.

Referenced by beginJob(), and fillCuts().

TH1D * IsoTrig::h_eNeutIso[2]
private

Definition at line 72 of file IsoTrig.h.

Referenced by beginJob(), and fillCuts().

TH1D * IsoTrig::h_eta[20]
private

Definition at line 69 of file IsoTrig.h.

Referenced by beginJob(), and fillHist().

TH1D * IsoTrig::h_etaCalibTracks[2][2]
private

Definition at line 72 of file IsoTrig.h.

Referenced by beginJob(), and fillCuts().

TH1D * IsoTrig::h_etaMipTracks[2][2]
private

Definition at line 70 of file IsoTrig.h.

Referenced by beginJob(), and fillCuts().

TH1I * IsoTrig::h_HLT
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_L1ObjEnergy
private

Definition at line 68 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_mindR[6]
private

Definition at line 71 of file IsoTrig.h.

Referenced by beginJob(), and fillDifferences().

TH1I* IsoTrig::h_nHLT
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1I * IsoTrig::h_nL3Objs
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D* IsoTrig::h_p[20]
private

Definition at line 69 of file IsoTrig.h.

Referenced by beginJob(), and fillHist().

TH1D * IsoTrig::h_phi[20]
private

Definition at line 69 of file IsoTrig.h.

Referenced by beginJob(), and fillHist().

TH1I * IsoTrig::h_Pre
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1I * IsoTrig::h_PreHLT
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_PreHLTwt
private

Definition at line 68 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1I * IsoTrig::h_PreL1
private

Definition at line 67 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D* IsoTrig::h_PreL1wt
private

Definition at line 68 of file IsoTrig.h.

Referenced by analyze(), and beginJob().

TH1D * IsoTrig::h_pt[20]
private

Definition at line 69 of file IsoTrig.h.

Referenced by beginJob(), and fillHist().

HLTConfigProvider IsoTrig::hltConfig_
private

Definition at line 55 of file IsoTrig.h.

Referenced by analyze(), and beginRun().

int IsoTrig::maxRunNo
private

Definition at line 62 of file IsoTrig.h.

Referenced by endJob(), and IsoTrig().

int IsoTrig::minRunNo
private

Definition at line 62 of file IsoTrig.h.

Referenced by endJob(), and IsoTrig().

spr::trackSelectionParameters IsoTrig::selectionParameters
private

Definition at line 58 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

std::string IsoTrig::theTrackQuality
private

Definition at line 59 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().

std::map<unsigned int, unsigned int> IsoTrig::TrigList
private

Definition at line 63 of file IsoTrig.h.

Referenced by analyze(), and endJob().

std::map<unsigned int, const std::pair<int, int> > IsoTrig::TrigPreList
private

Definition at line 64 of file IsoTrig.h.

Referenced by analyze(), and endJob().

int IsoTrig::verbosity
private

Definition at line 57 of file IsoTrig.h.

Referenced by analyze(), and IsoTrig().