75 double dphi = fabs(phi1 - phi2);
76 if(dphi>acos(-1)) dphi = 2*acos(-1)-dphi;
77 double dr =
sqrt(dphi*dphi +
pow(eta1-eta2,2));
86 double theta1=2*atan(
exp(-eta1));
87 double theta2=2*atan(
exp(-eta2));
88 if (fabs(eta1)<1.479) Rec=129;
101 for (
int i=1;
i<21;
i++)
103 if (fabs(eta)<(
i*0.087)&&fabs(eta)>(
i-1)*0.087) ieta=int(fabs(eta)/eta)*
i;
105 if (fabs(eta)>1.740&&fabs(eta)<1.830) ieta=int(fabs(eta)/eta)*21;
106 if (fabs(eta)>1.830&&fabs(eta)<1.930) ieta=int(fabs(eta)/eta)*22;
107 if (fabs(eta)>1.930&&fabs(eta)<2.043) ieta=int(fabs(eta)/eta)*23;
109 double delta=phi+0.174532925;
110 if (delta<0) delta=delta+2*acos(-1);
113 for (
int i=0;
i<72;
i++)
115 if (delta<(
i+1)*0.087266462&&delta>
i*0.087266462) iphi=
i;
120 for (
int i=0;
i<36;
i++)
122 if (delta<2*(
i+1)*0.087266462&&delta>2*
i*0.087266462) iphi=2*
i;
126 return std::pair<int,int>(ieta,iphi);
170 KEYS=trEv->filterKeys(iFilt);
176 std::vector<double> trigEta;
177 std::vector<double> trigPhi;
184 if (TObj.
p()<
pThr_)
continue;
189 if (recoIsoTracks->size()>0)
191 double minRecoL3dist=1000;
192 reco::IsolatedPixelTrackCandidateCollection::const_iterator mrtr;
193 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator rtrit=recoIsoTracks->begin(); rtrit!=recoIsoTracks->end(); rtrit++)
195 double R=
getDist(rtrit->eta(),rtrit->phi(),TObj.
eta(),TObj.
phi());
208 trigEta.push_back(TObj.
eta());
209 trigPhi.push_back(TObj.
phi());
213 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator itr=recoIsoTracks->begin(); itr!=recoIsoTracks->end(); itr++)
216 for (
unsigned int l=0;
l<trigEta.size();
l++)
218 if (
getDist(itr->eta(),itr->phi(),trigEta[
l],trigPhi[
l])<0.2) match=
true;
238 if (fabs(itr->eta())>0.5&&fabs(itr->eta())<1.0)
hOffP_0510->
Fill(itr->p(),1);
239 if (fabs(itr->eta())>1.0&&fabs(itr->eta())<1.5)
hOffP_1015->
Fill(itr->p(),1);
240 if (fabs(itr->eta())<1.5&&fabs(itr->eta())<2.0)
hOffP_1520->
Fill(itr->p(),1);
244 std::pair<int,int> TI=
towerIndex(itr->eta(),itr->phi());
251 std::cout << std::endl <<
" End / Start " << std::endl;
256 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator bll=recoIsoTracks->begin(); bll!=recoIsoTracks->end(); bll++)
259 std::cout<<
"ISO Pt " << bll->pt() <<
" P " << bll->p() <<
" Eta "<< bll->eta() <<
" Phi "<< bll->phi()<< std::endl;
261 double distanceMin = 1.;
262 double SimPtMatched = 1.;
263 double SimPhiMatched = 1.;
264 double SimEtaMatched = 1.;
265 double SimDistMatched = 1.;
266 double SimPMatched = 1.;
271 for(edm::SimTrackContainer::const_iterator tracksCI = simTracks->begin();
272 tracksCI != simTracks->end(); tracksCI++){
274 int partIndex = tracksCI->genpartIndex();
275 if (tracksCI->momentum().eta() > (bll->eta()-0.1)
276 && tracksCI->momentum().eta() < (bll->eta()+0.1)
277 && tracksCI->momentum().phi() > (bll->phi()-0.1)
278 && tracksCI->momentum().phi() < (bll->phi()+0.1)
281 && tracksCI->momentum().e() > 2.
282 && fabs(tracksCI->charge()) == 1 && partIndex >0)
285 double distance=
getDist(tracksCI->momentum().eta(),tracksCI->momentum().phi(),bll->eta(),bll->phi());
286 double distanceCM=
getDistInCM(tracksCI->momentum().eta(),tracksCI->momentum().phi(),bll->eta(),bll->phi());
288 if (distanceMin > distance) {
290 SimPtMatched = tracksCI->momentum().pt();
291 SimPhiMatched = tracksCI->momentum().phi();
292 SimEtaMatched = tracksCI->momentum().eta();
294 SimPMatched =
sqrt(tracksCI->momentum().pt()*tracksCI->momentum().pt() + tracksCI->momentum().pz()*tracksCI->momentum().pz());
297 std::cout<<
" Pt "<<tracksCI->momentum().pt()
298 <<
" Energy " << tracksCI->momentum().e()
299 <<
" Eta "<< tracksCI->momentum().eta()
300 <<
" Phi "<< tracksCI->momentum().phi()
301 <<
" Ind " << partIndex
302 <<
" Cha " << tracksCI->charge()
303 <<
" Dis " << distance
304 <<
" DCM " << distanceCM
311 tracksCI->momentum().eta() > (bll->eta()-0.5)
312 && tracksCI->momentum().eta() < (bll->eta()+0.5)
313 && tracksCI->momentum().phi() > (bll->phi()-0.5)
314 && tracksCI->momentum().phi() < (bll->phi()+0.5)
316 && tracksCI->charge() == 0 && partIndex >0)
319 double distance=
getDist(tracksCI->momentum().eta(),tracksCI->momentum().phi(),bll->eta(),bll->phi());
320 double distanceCM=
getDistInCM(tracksCI->momentum().eta(),tracksCI->momentum().phi(),bll->eta(),bll->phi());
322 std::cout<<
"NEU Pt "<<tracksCI->momentum().pt()
323 <<
" Energy " << tracksCI->momentum().e()
324 <<
" Eta "<< tracksCI->momentum().eta()
325 <<
" Phi "<< tracksCI->momentum().phi()
326 <<
" Ind " << partIndex
327 <<
" Cha " << tracksCI->charge()
328 <<
" Dis " << distance
329 <<
" DCM " << distanceCM
332 if (distanceCM < 40.){
334 neuen = neuen + tracksCI->momentum().e();
336 if (neuenm < tracksCI->momentum().
e()) neuenm = tracksCI->momentum().e();
348 if (distanceMin < 0.1) {
363 if (distanceMin > 0.1) {
453 hSimDist=
dbe_->
book1D(
"hSimDist",
"Distance from matched SimTrack to Offline Track",200,0,0.1);
465 hSimNN=
dbe_->
book1D(
"hSimNN",
"Number of the neutral particles in cone on ECAL",100,0,100);
468 hSimNE=
dbe_->
book1D(
"hSimNE",
"Total energy of the neutral particles in cone on ECAL",100,0,100);
471 hSimNM=
dbe_->
book1D(
"hSimNM",
"Maximum energy of the neutral particles in cone on ECAL",100,0,100);
MonitorElement * hOffL3TrackPtRat
MonitorElement * hOffP_1015
T getParameter(std::string const &) const
MonitorElement * hOffPhiFP
T getUntrackedParameter(std::string const &, T const &) const
std::string outRootFileName_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTrack_
double getDist(double, double, double, double)
MonitorElement * hl3AbsEta
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_arITr_
Single trigger physics object (e.g., an isolated muon)
edm::InputTag recoTrLabel_
MonitorElement * hOffL3TrackMatch
MonitorElement * hOffAbsEta
std::pair< int, int > towerIndex(double eta, double phi)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
edm::InputTag hltFilterTag_
MonitorElement * hOffP_0005
MonitorElement * hOccupancyFull
~ValidationHcalIsoTrackAlCaReco()
MonitorElement * hOccupancyHighEn
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
MonitorElement * hDeposEcalInner
std::vector< size_type > Keys
edm::EDGetTokenT< trigger::TriggerEvent > tok_hlt_
MonitorElement * hOffEtaFP
MonitorElement * hSimAbsEta
MonitorElement * hTracksSumP
MonitorElement * hSimDist
ValidationHcalIsoTrackAlCaReco(const edm::ParameterSet &)
MonitorElement * hSimPtRatOff
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * hTracksMaxP
MonitorElement * hDeposEcalOuter
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
MonitorElement * hOffP_0510
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::vector< SimTrack > SimTrackContainer
MonitorElement * hOffP_1520
Power< A, B >::type pow(const A &a, const B &b)
void setCurrentFolder(const std::string &fullpath)