65 if (
verbosity > 0)
std::cout <<
"Event starts====================================" << std::endl;
66 int RunNo = iEvent.
id().
run();
67 int EvtNo = iEvent.
id().
event();
80 std::cout <<
"RunNo " << RunNo <<
" EvtNo " << EvtNo <<
" Lumi " << Lumi
81 <<
" Bunch " << Bunch <<
" mybxlumi " << mybxlumi << std::endl;
83 edm::InputTag triggerEvent_ (
"hltTriggerSummaryAOD",
"",
"HLT");
86 iEvent.
getByLabel(triggerEvent_,triggerEventHandle);
88 if (!triggerEventHandle.
isValid())
89 std::cout <<
"Error! Can't get the product "<< triggerEvent_.
label() << std::endl;
91 triggerEvent = *(triggerEventHandle.
product());
94 edm::InputTag theTriggerResultsLabel (
"TriggerResults",
"",
"HLT");
96 iEvent.
getByLabel( theTriggerResultsLabel, triggerResults);
99 h_nHLT->Fill(triggerResults->size());
100 h_nHLTvsRN->Fill(RunNo, triggerResults->size());
103 const std::vector<std::string> & triggerNames_ = triggerNames.
triggerNames();
105 for (
unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
110 if (triggerNames_[iHLT] ==
HLTNames[
i]) {
117 HLTNames.push_back(triggerNames_[iHLT]);
118 h_HLTAccept->GetXaxis()->SetBinLabel(ipos+1,triggerNames_[iHLT].c_str());
121 int hlt = triggerResults->accept(iHLT);
126 if (iHLT >= 499)
std::cout <<
"Wrong trigger " << RunNo <<
" Event " << EvtNo <<
" Hlt " << iHLT << std::endl;
128 if (triggerNames_[iHLT].
find(
trigNames[
i].c_str())!=std::string::npos) {
130 if (hlt > 0) ok =
true;
157 iEvent.
getByLabel(
"generalTracks", trkCollection);
158 reco::TrackCollection::const_iterator trkItr;
160 for (trkItr=trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr,++ntrk) {
162 double pt1 = pTrack->
pt();
163 double p1 = pTrack->
p();
164 double eta1 = pTrack->
momentum().eta();
165 double phi1 = pTrack->
momentum().phi();
168 if (quality)
fillTrack(1, pt1,p1,eta1,phi1);
172 std::vector<spr::propagatedTrackID> trkCaloDets;
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;
193 iEvent.
getByLabel(
"ecalRecHit",
"EcalRecHitsEB",barrelRecHitsHandle);
194 iEvent.
getByLabel(
"ecalRecHit",
"EcalRecHitsEE",endcapRecHitsHandle);
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_);
202 double h5x5=0, h7x7=0;
204 if(
verbosity > 0)
std::cout <<
"Accepted Tracks reaching Ecal maxNearP31x31/e11x11P/e15x15P/okHCAL " << maxNearP31x31 <<
"/" << e11x11P.first <<
"/" << e15x15P.first <<
"/" << trkDetItr->okHCAL << std::endl;
206 if (trkDetItr->okHCAL) {
210 const DetId ClosestCell(trkDetItr->detIdHCAL);
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_);
215 if(
verbosity)
std::cout <<
"Tracks Reaching Hcal maxNearHcalP7x7/h5x5/h7x7 " << maxNearHcalP7x7 <<
"/" << h5x5 <<
"/" << h7x7 << std::endl;
217 if (maxNearP31x31 < 0) {
219 if (maxNearHcalP7x7 < 0) {
221 if (e11x11P.second && e15x15P.second && (e15x15P.first-e11x11P.first)<2.0) {
223 if (h7x7-h5x5 < 2.0) {
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);
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());
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);
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);
262 sprintf(hname,
"h_eta_%s", TrkNames[
i].c_str());
263 sprintf(htit,
"Eta of %s tracks", TrkNames[
i].c_str());
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);
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());
279 sprintf(hname,
"h_ene1_%s", IsolationNames[
i].c_str());
280 sprintf(htit,
"Energy in smaller cone for %s", IsolationNames[
i].c_str());
284 sprintf(hname,
"h_ene2_%s", IsolationNames[
i].c_str());
285 sprintf(htit,
"Energy in bigger cone for %s", IsolationNames[
i].c_str());
289 sprintf(hname,
"h_ediff_%s", IsolationNames[
i].c_str());
290 sprintf(htit,
"Energy in NeutralIso region for %s", IsolationNames[
i].c_str());
300 char hname[100], htit[100];
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);
333 h_ediff[
i]->Fill(eneutIso2-eneutIso1);
double p() const
momentum vector magnitude
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
const Vector & momentum() const
track momentum vector
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
The single EDProduct to be saved for each event (AOD case)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::Service< TFileService > fs
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
std::vector< TH1I * > h_HLTAccepts
std::vector< std::string > trigNames
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
T * make(const Args &...args) const
make new ROOT object
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Strings const & triggerNames() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string theTrackQuality
spr::trackSelectionParameters selectionParameters
void fillIsolation(int, double, double, double)
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)
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)
double pt() const
track transverse momentum
virtual void endRun(edm::Run const &, edm::EventSetup const &)
Abs< T >::type abs(const T &t)
LuminosityBlock const & getLuminosityBlock() const
HLTConfigProvider hltConfig_
static std::string const triggerResults
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static TrackQuality qualityByName(const std::string &name)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
T const * product() const
T const * product() const
bool quality(const TrackQuality) const
Track quality.
reco::TrackBase::TrackQuality minQuality
std::vector< std::string > HLTNames
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
StudyHLT(const edm::ParameterSet &)
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
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)