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) {
double p() const
momentum vector magnitude
EventNumber_t event() 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
The single EDProduct to be saved for each event (AOD case)
std::vector< TH1I * > h_HLTAccepts
std::vector< std::string > trigNames
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
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
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
Abs< T >::type abs(const T &t)
LuminosityBlock const & getLuminosityBlock() const
static std::string const triggerResults
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
T const * product() const
bool quality(const TrackQuality) const
Track quality.
reco::TrackBase::TrackQuality minQuality
std::vector< std::string > HLTNames
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)