CMS 3D CMS Logo

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

#include <StudyHLT.h>

Inheritance diagram for StudyHLT:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 StudyHLT (const edm::ParameterSet &)
 
 ~StudyHLT ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
void fillIsolation (int, double, double, double)
 
void fillTrack (int, double, double, double, double)
 

Private Attributes

bool changed
 
bool firstEvent
 
edm::Service< TFileServicefs
 
TH1D * h_ediff [2]
 
TH1D * h_ene1 [2]
 
TH1D * h_ene2 [2]
 
TH1D * h_eta [8]
 
TH1I * h_HLTAccept
 
std::vector< TH1I * > h_HLTAccepts
 
TH1D * h_maxNearP [2]
 
TH1I * h_nHLT
 
TH2I * h_nHLTvsRN
 
TH1I * h_ntrk [2]
 
TH1D * h_p [8]
 
TH1D * h_phi [8]
 
TH1D * h_pt [8]
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames
 
double maxTrackEta
 
double minTrackP
 
int nRun
 
spr::trackSelectionParameters selectionParameters
 
std::string theTrackQuality
 
double tMaxE_
 
double tMaxH_
 
double tMinE_
 
double tMinH_
 
std::vector< std::string > trigNames
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Definition at line 26 of file StudyHLT.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file StudyHLT.cc.

References edm::ParameterSet::getUntrackedParameter(), spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, maxTrackEta, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, minTrackP, reco::TrackBase::qualityByName(), selectionParameters, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality, tMaxE_, tMaxH_, tMinE_, tMinH_, trigNames, and verbosity.

38  : nRun(0) {
39  verbosity = iConfig.getUntrackedParameter<int>("Verbosity",0);
40  trigNames = iConfig.getUntrackedParameter<std::vector<std::string> >("Triggers");
41  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
43  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
44  selectionParameters.minQuality = trackQuality_;
45  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
46  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
47  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
48  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
49  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
50  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
51  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
52  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
53  minTrackP = iConfig.getUntrackedParameter<double>("MinTrackP", 1.0);
54  maxTrackEta = iConfig.getUntrackedParameter<double>("MaxTrackEta", 2.5);
55  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
56  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
57  tMinH_ = iConfig.getUntrackedParameter<double>("TimeMinCutHCAL", -500.);
58  tMaxH_ = iConfig.getUntrackedParameter<double>("TimeMaxCutHCAL", 500.);
59 }
T getUntrackedParameter(std::string const &, T const &) const
double maxTrackEta
Definition: StudyHLT.h:51
TrackQuality
track quality
Definition: TrackBase.h:93
std::vector< std::string > trigNames
Definition: StudyHLT.h:49
double tMaxH_
Definition: StudyHLT.h:51
double minTrackP
Definition: StudyHLT.h:51
std::string theTrackQuality
Definition: StudyHLT.h:50
spr::trackSelectionParameters selectionParameters
Definition: StudyHLT.h:48
int nRun
Definition: StudyHLT.h:59
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
int verbosity
Definition: StudyHLT.h:47
reco::TrackBase::TrackQuality minQuality
double tMinE_
Definition: StudyHLT.h:51
double tMinH_
Definition: StudyHLT.h:51
double tMaxE_
Definition: StudyHLT.h:51
StudyHLT::~StudyHLT ( )

Definition at line 61 of file StudyHLT.cc.

61  {
62 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 64 of file StudyHLT.cc.

References funct::abs(), ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), spr::chargeIsolationEcal(), spr::chargeIsolationHcal(), gather_cfg::cout, spr::eECALmatrix(), spr::eHCALmatrix(), edm::EventID::event(), fillIsolation(), fillTrack(), spr::find(), firstEvent, edm::EventSetup::get(), edm::LuminosityBlock::getByLabel(), edm::Event::getByLabel(), edm::Event::getLuminosityBlock(), h_HLTAccept, h_HLTAccepts, h_nHLT, h_nHLTvsRN, h_ntrk, runregparse::hlt, HLTNames, i, edm::EventBase::id(), edm::HandleBase::isValid(), LumiDetails::kOCC1, edm::InputTag::label(), edm::EventBase::luminosityBlock(), FastTimerService_cff::lumiProducer, maxTrackEta, spr::trackSelectionParameters::minQuality, minTrackP, reco::TrackBase::momentum(), nRun, convertSQLiteXML::ok, reco::TrackBase::p(), p1, edm::Handle< T >::product(), edm::ESHandle< class >::product(), spr::propagateCALO(), reco::TrackBase::pt(), reco::TrackBase::quality(), edm::EventID::run(), selectionParameters, theTrackQuality, tMaxE_, tMaxH_, tMinE_, tMinH_, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, trigNames, and verbosity.

64  {
65  if (verbosity > 0) std::cout << "Event starts====================================" << std::endl;
66  int RunNo = iEvent.id().run();
67  int EvtNo = iEvent.id().event();
68  int Lumi = iEvent.luminosityBlock();
69  int Bunch = iEvent.bunchCrossing();
70 
71  edm::InputTag lumiProducer("LumiProducer", "", "RECO");
73  iEvent.getLuminosityBlock().getByLabel("lumiProducer",Lumid);
74 
75  float mybxlumi=-1;
76  if (Lumid.isValid())
77  mybxlumi=Lumid->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
78 
79  if (verbosity > 0)
80  std::cout << "RunNo " << RunNo << " EvtNo " << EvtNo << " Lumi " << Lumi
81  << " Bunch " << Bunch << " mybxlumi " << mybxlumi << std::endl;
82 
83  edm::InputTag triggerEvent_ ("hltTriggerSummaryAOD","","HLT");
84  trigger::TriggerEvent triggerEvent;
85  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
86  iEvent.getByLabel(triggerEvent_,triggerEventHandle);
87 
88  if (!triggerEventHandle.isValid())
89  std::cout << "Error! Can't get the product "<< triggerEvent_.label() << std::endl;
90  else {
91  triggerEvent = *(triggerEventHandle.product());
92 
94  edm::InputTag theTriggerResultsLabel ("TriggerResults","","HLT");
96  iEvent.getByLabel( theTriggerResultsLabel, triggerResults);
97 
98  if (triggerResults.isValid()) {
99  h_nHLT->Fill(triggerResults->size());
100  h_nHLTvsRN->Fill(RunNo, triggerResults->size());
101 
102  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
103  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
104  bool ok(false);
105  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
106  // unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[iHLT]);
107  // const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
108  int ipos=-1;
109  for (unsigned int i=0; i<HLTNames.size(); ++i) {
110  if (triggerNames_[iHLT] == HLTNames[i]) {
111  ipos = i;
112  break;
113  }
114  }
115  if (ipos < 0) {
116  ipos = (int)(HLTNames.size()+1);
117  HLTNames.push_back(triggerNames_[iHLT]);
118  h_HLTAccept->GetXaxis()->SetBinLabel(ipos+1,triggerNames_[iHLT].c_str());
119  }
120  if (firstEvent) h_HLTAccepts[nRun]->GetXaxis()->SetBinLabel(iHLT+1, triggerNames_[iHLT].c_str());
121  int hlt = triggerResults->accept(iHLT);
122  if (hlt) {
123  h_HLTAccepts[nRun]->Fill(iHLT+1);
124  h_HLTAccept->Fill(ipos+1);
125  }
126  if (iHLT >= 499) std::cout << "Wrong trigger " << RunNo << " Event " << EvtNo << " Hlt " << iHLT << std::endl;
127  for (unsigned int i=0; i<trigNames.size(); ++i) {
128  if (triggerNames_[iHLT].find(trigNames[i].c_str())!=std::string::npos) {
129  if(verbosity) std::cout << triggerNames_[iHLT] << std::endl;
130  if (hlt > 0) ok = true;
131  }
132  }
133  }
134  if (ok) {
135  // get handles to calogeometry and calotopology
137  iSetup.get<CaloGeometryRecord>().get(pG);
138  const CaloGeometry* geo = pG.product();
139 
140  edm::ESHandle<CaloTopology> theCaloTopology;
141  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
142  const CaloTopology *caloTopology = theCaloTopology.product();
143 
145  iSetup.get<IdealGeometryRecord>().get(htopo);
146  const HcalTopology* theHBHETopology = htopo.product();
147 
149  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
150  const MagneticField *bField = bFieldH.product();
151 
153  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
154  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
155 
157  iEvent.getByLabel("generalTracks", trkCollection);
158  reco::TrackCollection::const_iterator trkItr;
159  int ntrk = 0;
160  for (trkItr=trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr,++ntrk) {
161  const reco::Track* pTrack = &(*trkItr);
162  double pt1 = pTrack->pt();
163  double p1 = pTrack->p();
164  double eta1 = pTrack->momentum().eta();
165  double phi1 = pTrack->momentum().phi();
166  bool quality = pTrack->quality(selectionParameters.minQuality);
167  fillTrack(0, pt1,p1,eta1,phi1);
168  if (quality) fillTrack(1, pt1,p1,eta1,phi1);
169  }
170  h_ntrk[0]->Fill(ntrk);
171 
172  std::vector<spr::propagatedTrackID> trkCaloDets;
173  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDets, false);
174  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
175  for (trkDetItr = trkCaloDets.begin(),ntrk=0; trkDetItr != trkCaloDets.end(); trkDetItr++,ntrk++) {
176  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
177  double pt1 = pTrack->pt();
178  double p1 = pTrack->p();
179  double eta1 = pTrack->momentum().eta();
180  double phi1 = pTrack->momentum().phi();
181  if(verbosity > 0) std::cout << "track (p/pt/eta/phi/okEcal) : " << p1 << "/" << pt1 << "/" << eta1 << "/" << phi1 << "/" << trkDetItr->okECAL << std::endl;
182  fillTrack(2, pt1,p1,eta1,phi1);
183 
184  if (pt1>minTrackP && std::abs(eta1)<maxTrackEta && trkDetItr->okECAL) {
185  fillTrack(3, pt1,p1,eta1,phi1);
186  double maxNearP31x31 = spr::chargeIsolationEcal(ntrk, trkCaloDets, geo, caloTopology, 15, 15);
187 
189  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
190 
191  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
192  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
193  iEvent.getByLabel("ecalRecHit","EcalRecHitsEB",barrelRecHitsHandle);
194  iEvent.getByLabel("ecalRecHit","EcalRecHitsEE",endcapRecHitsHandle);
195  // get ECal Tranverse Profile
196  std::pair<double, bool> e11x11P, e15x15P;
197  const DetId isoCell = trkDetItr->detIdECAL;
198  e11x11P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.060, 0.300, tMinE_,tMaxE_);
199  e15x15P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.060, 0.300, tMinE_,tMaxE_);
200 
201  double maxNearHcalP7x7 = spr::chargeIsolationHcal(ntrk, trkCaloDets, theHBHETopology, 3,3);
202  double h5x5=0, h7x7=0;
203  fillIsolation(0, maxNearP31x31,e11x11P.first,e15x15P.first);
204  if(verbosity > 0) std::cout << "Accepted Tracks reaching Ecal maxNearP31x31/e11x11P/e15x15P/okHCAL " << maxNearP31x31 << "/" << e11x11P.first << "/" << e15x15P.first << "/" << trkDetItr->okHCAL << std::endl;
205 
206  if (trkDetItr->okHCAL) {
208  iEvent.getByLabel("hbhereco", hbhe);
209 
210  const DetId ClosestCell(trkDetItr->detIdHCAL);
211  // bool includeHO=false, bool algoNew=true, bool debug=false
212  h5x5 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,2,2, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_,tMaxH_);
213  h7x7 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,3,3, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_,tMaxH_);
214  fillIsolation(1, maxNearHcalP7x7,h5x5,h7x7);
215  if(verbosity) std::cout << "Tracks Reaching Hcal maxNearHcalP7x7/h5x5/h7x7 " << maxNearHcalP7x7 << "/" << h5x5 << "/" << h7x7 << std::endl;
216  }
217  if (maxNearP31x31 < 0) {
218  fillTrack(4, pt1,p1,eta1,phi1);
219  if (maxNearHcalP7x7 < 0) {
220  fillTrack(5, pt1,p1,eta1,phi1);
221  if (e11x11P.second && e15x15P.second && (e15x15P.first-e11x11P.first)<2.0) {
222  fillTrack(6, pt1,p1,eta1,phi1);
223  if (h7x7-h5x5 < 2.0) {
224  fillTrack(7, pt1,p1,eta1,phi1);
225  }
226  }
227  }
228  }
229  }
230  }
231  h_ntrk[1]->Fill(ntrk);
232  }
233  }
234  }
235  firstEvent = false;
236 }
RunNumber_t run() const
Definition: EventID.h:42
double p() const
momentum vector magnitude
Definition: TrackBase.h:127
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:204
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
TH1I * h_nHLT
Definition: StudyHLT.h:53
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:148
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
TH1I * h_ntrk[2]
Definition: StudyHLT.h:57
double maxTrackEta
Definition: StudyHLT.h:51
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.h:55
std::vector< std::string > trigNames
Definition: StudyHLT.h:49
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
double tMaxH_
Definition: StudyHLT.h:51
TH1I * h_HLTAccept
Definition: StudyHLT.h:53
double minTrackP
Definition: StudyHLT.h:51
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
std::string theTrackQuality
Definition: StudyHLT.h:50
spr::trackSelectionParameters selectionParameters
Definition: StudyHLT.h:48
void fillIsolation(int, double, double, double)
Definition: StudyHLT.cc:329
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
bool firstEvent
Definition: StudyHLT.h:52
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
void fillTrack(int, double, double, double, double)
Definition: StudyHLT.cc:322
int nRun
Definition: StudyHLT.h:59
double pt() const
track transverse momentum
Definition: TrackBase.h:129
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:80
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
Definition: DetId.h:18
TH2I * h_nHLTvsRN
Definition: StudyHLT.h:54
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:375
int verbosity
Definition: StudyHLT.h:47
edm::EventID id() const
Definition: EventBase.h:56
double p1[4]
Definition: TauolaWrapper.h:89
reco::TrackBase::TrackQuality minQuality
std::vector< std::string > HLTNames
Definition: StudyHLT.h:49
tuple cout
Definition: gather_cfg.py:121
double tMinE_
Definition: StudyHLT.h:51
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
double tMinH_
Definition: StudyHLT.h:51
double tMaxE_
Definition: StudyHLT.h:51
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
void StudyHLT::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 238 of file StudyHLT.cc.

References fs, h_ediff, h_ene1, h_ene2, h_eta, h_HLTAccept, h_maxNearP, h_nHLT, h_nHLTvsRN, h_ntrk, h_p, h_phi, h_pt, i, TFileService::make(), and AlCaHLTBitMon_QueryRunRegistry::string.

238  {
239  h_nHLT = fs->make<TH1I>("h_nHLT" , "size of trigger Names", 1000, 0, 1000);
240  h_HLTAccept = fs->make<TH1I>("h_HLTAccept", "HLT Accepts for all runs", 500, 0, 500);
241  h_nHLTvsRN = fs->make<TH2I>("h_nHLTvsRN" , "size of trigger Names vs RunNo", 2168, 190949, 193116, 100, 400, 500);
242 
243  char hname[50], htit[100];
244  std::string CollectionNames[2] = {"Reco", "Propagated"};
245  for(unsigned int i=0; i<2; i++) {
246  sprintf(hname, "h_nTrk_%s", CollectionNames[i].c_str());
247  sprintf(htit, "Number of %s tracks", CollectionNames[i].c_str());
248  h_ntrk[i] = fs->make<TH1I>(hname, htit, 500, 0, 500);
249  }
250  std::string TrkNames[8] = {"All", "Quality", "NoIso", "okEcal", "EcalCharIso", "HcalCharIso", "EcalNeutIso", "HcalNeutIso"};
251  for(unsigned int i=0; i<8; i++) {
252  sprintf(hname, "h_pt_%s", TrkNames[i].c_str());
253  sprintf(htit, "p_{T} of %s tracks", TrkNames[i].c_str());
254  h_pt[i] = fs->make<TH1D>(hname, htit, 400, 0, 200.0);
255  h_pt[i]->Sumw2();
256 
257  sprintf(hname, "h_p_%s", TrkNames[i].c_str());
258  sprintf(htit, "Momentum of %s tracks", TrkNames[i].c_str());
259  h_p[i] = fs->make<TH1D>(hname, htit, 400, 0, 200.0);
260  h_p[i]->Sumw2();
261 
262  sprintf(hname, "h_eta_%s", TrkNames[i].c_str());
263  sprintf(htit, "Eta of %s tracks", TrkNames[i].c_str());
264  h_eta[i] = fs->make<TH1D>(hname, htit, 60, -3.0, 3.0);
265  h_eta[i]->Sumw2();
266 
267  sprintf(hname, "h_phi_%s", TrkNames[i].c_str());
268  sprintf(htit, "Phi of %s tracks", TrkNames[i].c_str());
269  h_phi[i] = fs->make<TH1D>(hname, htit, 100, -3.15, 3.15);
270  h_phi[i]->Sumw2();
271  }
272  std::string IsolationNames[2] = {"Ecal", "Hcal"};
273  for(unsigned int i=0; i<2; i++) {
274  sprintf(hname, "h_maxNearP_%s", IsolationNames[i].c_str());
275  sprintf(htit, "Energy in ChargeIso region for %s", IsolationNames[i].c_str());
276  h_maxNearP[i] = fs->make<TH1D>(hname, htit, 120, -1.5, 10.5);
277  h_maxNearP[i]->Sumw2();
278 
279  sprintf(hname, "h_ene1_%s", IsolationNames[i].c_str());
280  sprintf(htit, "Energy in smaller cone for %s", IsolationNames[i].c_str());
281  h_ene1[i] = fs->make<TH1D>(hname, htit, 400, 0.0, 200.0);
282  h_ene1[i]->Sumw2();
283 
284  sprintf(hname, "h_ene2_%s", IsolationNames[i].c_str());
285  sprintf(htit, "Energy in bigger cone for %s", IsolationNames[i].c_str());
286  h_ene2[i] = fs->make<TH1D>(hname, htit, 400, 0.0, 200.0);
287  h_ene2[i]->Sumw2();
288 
289  sprintf(hname, "h_ediff_%s", IsolationNames[i].c_str());
290  sprintf(htit, "Energy in NeutralIso region for %s", IsolationNames[i].c_str());
291  h_ediff[i] = fs->make<TH1D>(hname, htit, 100, -0.5, 19.5);
292  h_ediff[i]->Sumw2();
293  }
294 }
int i
Definition: DBlmapReader.cc:9
TH1I * h_nHLT
Definition: StudyHLT.h:53
edm::Service< TFileService > fs
Definition: StudyHLT.h:46
TH1I * h_ntrk[2]
Definition: StudyHLT.h:57
TH1D * h_p[8]
Definition: StudyHLT.h:56
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1I * h_HLTAccept
Definition: StudyHLT.h:53
TH1D * h_eta[8]
Definition: StudyHLT.h:56
TH1D * h_ene2[2]
Definition: StudyHLT.h:58
TH1D * h_pt[8]
Definition: StudyHLT.h:56
TH1D * h_ene1[2]
Definition: StudyHLT.h:58
TH1D * h_ediff[2]
Definition: StudyHLT.h:58
TH1D * h_maxNearP[2]
Definition: StudyHLT.h:58
TH2I * h_nHLTvsRN
Definition: StudyHLT.h:54
TH1D * h_phi[8]
Definition: StudyHLT.h:56
void StudyHLT::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 318 of file StudyHLT.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 299 of file StudyHLT.cc.

References changed, gather_cfg::cout, firstEvent, fs, h_HLTAccepts, hltConfig_, HLTConfigProvider::init(), TFileService::make(), nRun, and edm::RunBase::run().

299  {
300  char hname[100], htit[100];
301  std::cout << "Run[" << nRun << "] " << iRun.run() << " hltconfig.init "
302  << hltConfig_.init(iRun,iSetup,"HLT",changed) << std::endl;
303  sprintf(hname, "h_HLTAccepts_%i", iRun.run());
304  sprintf(htit, "HLT Accepts for Run No %i", iRun.run());
305  TH1I *hnew = fs->make<TH1I>(hname, htit, 500, 0, 500);
306  h_HLTAccepts.push_back(hnew);
307  std::cout << "beginrun " << iRun.run() << std::endl;
308  firstEvent = true;
309 }
edm::Service< TFileService > fs
Definition: StudyHLT.h:46
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.h:55
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
bool firstEvent
Definition: StudyHLT.h:52
int nRun
Definition: StudyHLT.h:59
HLTConfigProvider hltConfig_
Definition: StudyHLT.h:45
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
bool changed
Definition: StudyHLT.h:52
tuple cout
Definition: gather_cfg.py:121
void StudyHLT::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 296 of file StudyHLT.cc.

296 {}
void StudyHLT::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 320 of file StudyHLT.cc.

320 {}
void StudyHLT::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 312 of file StudyHLT.cc.

References gather_cfg::cout, nRun, and edm::RunBase::run().

312  {
313  nRun++;
314  std::cout << "endrun[" << nRun << "] " << iRun.run() << std::endl;
315 }
int nRun
Definition: StudyHLT.h:59
tuple cout
Definition: gather_cfg.py:121
void StudyHLT::fillIsolation ( int  i,
double  emaxnearP,
double  eneutIso1,
double  eneutIso2 
)
private

Definition at line 329 of file StudyHLT.cc.

References h_ediff, h_ene1, h_ene2, h_maxNearP, and i.

Referenced by analyze().

329  {
330  h_maxNearP[i]->Fill(emaxnearP);
331  h_ene1[i]->Fill(eneutIso1);
332  h_ene2[i]->Fill(eneutIso2);
333  h_ediff[i]->Fill(eneutIso2-eneutIso1);
334 }
int i
Definition: DBlmapReader.cc:9
TH1D * h_ene2[2]
Definition: StudyHLT.h:58
TH1D * h_ene1[2]
Definition: StudyHLT.h:58
TH1D * h_ediff[2]
Definition: StudyHLT.h:58
TH1D * h_maxNearP[2]
Definition: StudyHLT.h:58
void StudyHLT::fillTrack ( int  i,
double  pt,
double  p,
double  eta,
double  phi 
)
private

Definition at line 322 of file StudyHLT.cc.

References h_eta, h_p, h_phi, h_pt, and i.

Referenced by analyze().

322  {
323  h_pt[i]->Fill(pt);
324  h_p[i]->Fill(p);
325  h_eta[i]->Fill(eta);
326  h_phi[i]->Fill(phi);
327 }
int i
Definition: DBlmapReader.cc:9
TH1D * h_p[8]
Definition: StudyHLT.h:56
T eta() const
TH1D * h_eta[8]
Definition: StudyHLT.h:56
TH1D * h_pt[8]
Definition: StudyHLT.h:56
TH1D * h_phi[8]
Definition: StudyHLT.h:56
Definition: DDAxes.h:10

Member Data Documentation

bool StudyHLT::changed
private

Definition at line 52 of file StudyHLT.h.

Referenced by beginRun().

bool StudyHLT::firstEvent
private

Definition at line 52 of file StudyHLT.h.

Referenced by analyze(), and beginRun().

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

Definition at line 46 of file StudyHLT.h.

Referenced by beginJob(), and beginRun().

TH1D * StudyHLT::h_ediff[2]
private

Definition at line 58 of file StudyHLT.h.

Referenced by beginJob(), and fillIsolation().

TH1D * StudyHLT::h_ene1[2]
private

Definition at line 58 of file StudyHLT.h.

Referenced by beginJob(), and fillIsolation().

TH1D * StudyHLT::h_ene2[2]
private

Definition at line 58 of file StudyHLT.h.

Referenced by beginJob(), and fillIsolation().

TH1D * StudyHLT::h_eta[8]
private

Definition at line 56 of file StudyHLT.h.

Referenced by beginJob(), and fillTrack().

TH1I * StudyHLT::h_HLTAccept
private

Definition at line 53 of file StudyHLT.h.

Referenced by analyze(), and beginJob().

std::vector<TH1I*> StudyHLT::h_HLTAccepts
private

Definition at line 55 of file StudyHLT.h.

Referenced by analyze(), and beginRun().

TH1D* StudyHLT::h_maxNearP[2]
private

Definition at line 58 of file StudyHLT.h.

Referenced by beginJob(), and fillIsolation().

TH1I* StudyHLT::h_nHLT
private

Definition at line 53 of file StudyHLT.h.

Referenced by analyze(), and beginJob().

TH2I* StudyHLT::h_nHLTvsRN
private

Definition at line 54 of file StudyHLT.h.

Referenced by analyze(), and beginJob().

TH1I* StudyHLT::h_ntrk[2]
private

Definition at line 57 of file StudyHLT.h.

Referenced by analyze(), and beginJob().

TH1D* StudyHLT::h_p[8]
private

Definition at line 56 of file StudyHLT.h.

Referenced by beginJob(), and fillTrack().

TH1D * StudyHLT::h_phi[8]
private

Definition at line 56 of file StudyHLT.h.

Referenced by beginJob(), and fillTrack().

TH1D * StudyHLT::h_pt[8]
private

Definition at line 56 of file StudyHLT.h.

Referenced by beginJob(), and fillTrack().

HLTConfigProvider StudyHLT::hltConfig_
private

Definition at line 45 of file StudyHLT.h.

Referenced by beginRun().

std::vector<std::string> StudyHLT::HLTNames
private

Definition at line 49 of file StudyHLT.h.

Referenced by analyze().

double StudyHLT::maxTrackEta
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

double StudyHLT::minTrackP
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

int StudyHLT::nRun
private

Definition at line 59 of file StudyHLT.h.

Referenced by analyze(), beginRun(), and endRun().

spr::trackSelectionParameters StudyHLT::selectionParameters
private

Definition at line 48 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

std::string StudyHLT::theTrackQuality
private

Definition at line 50 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

double StudyHLT::tMaxE_
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

double StudyHLT::tMaxH_
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

double StudyHLT::tMinE_
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

double StudyHLT::tMinH_
private

Definition at line 51 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

std::vector<std::string> StudyHLT::trigNames
private

Definition at line 49 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().

int StudyHLT::verbosity
private

Definition at line 47 of file StudyHLT.h.

Referenced by analyze(), and StudyHLT().