241 <<
" starts ==========" << std::endl;
259 reco::TrackCollection::const_iterator trkItr;
270 std::vector<PileupSummaryInfo>::const_iterator PVI;
271 for (PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) {
272 int BX = PVI->getBunchCrossing();
280 int ivtx = (int)(
vbin.size()-2);
281 for (
unsigned int iv=1; iv<
vbin.size(); ++iv) {
292 << ivtx <<
":" <<
vbin.size() << std::endl;
298 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
300 double genJetPt = genJet.
pt();
301 double genJetEta = genJet.
eta();
304 if (genJetEta>-2.5 && genJetEta<2.5) {
317 if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
318 leadPV =
math::XYZPoint( (*recVtxs)[0].
x(),(*recVtxs)[0].
y(), (*recVtxs)[0].
z() );
319 }
else if (beamSpotH.
isValid()) {
320 leadPV = beamSpotH->position();
324 std::cout <<
"Primary Vertex " << leadPV;
326 << beamSpotH->position();
339 for (rhitItr=hbhe->begin();rhitItr!=hbhe->end();rhitItr++) {
340 double rec_energy = rhitItr->energy();
341 int rec_ieta = rhitItr->id().ieta();
342 int rec_depth = rhitItr->id().depth();
343 int rec_zside = rhitItr->id().zside();
344 double num1_1 = rec_zside*(rec_ieta+0.2*(rec_depth-1));
347 std::cout <<
"detid/rechit/ieta/zside/depth/num = " << rhitItr->id()
348 <<
"/" << rec_energy <<
"/" << rec_ieta <<
"/" << rec_zside
349 <<
"/" << rec_depth <<
"/" << num1_1 << std::endl;
358 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
360 trkCaloDirections, ((
verbosity/100)%10>2));
361 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
362 for (trkDetItr = trkCaloDirections.begin();
363 trkDetItr != trkCaloDirections.end(); trkDetItr++) {
364 if (trkDetItr->okHCAL) {
366 int tk_ieta = detId.
ieta();
367 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
368 double tk_p = pTrack->
p();
372 std::cout <<
"Fill for " << tk_ieta <<
" in " << ivtx <<
":"
373 <<
h_tketav1[ivtx][0]->GetName() << std::endl;
375 for (
unsigned int k=1;
k<
pbin.size(); ++
k) {
380 std::cout <<
"Fill for " << tk_ieta <<
":" << tk_p <<
" in " << ivtx
381 <<
":" <<
h_tketav1[ivtx][
k]->GetName() << std::endl;
396 if (!triggerEventHandle.
isValid()) {
402 triggerEvent = *(triggerEventHandle.
product());
408 if (triggerResults.isValid()) {
409 std::vector<std::string>
modules;
411 const std::vector<std::string> & triggerNames_ = triggerNames.
triggerNames();
412 for (
unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
414 int hlt = triggerResults->accept(iHLT);
416 if (triggerNames_[iHLT].
find(
trigNames[
i].c_str())!=std::string::npos) {
425 std::cout <<
"This is the trigger we are looking for "
426 << triggerNames_[iHLT] <<
" Flag " << hlt <<
":"
435 std::vector<math::XYZTLorentzVector> vec[3];
437 for (
unsigned int ifilter=0; ifilter<triggerEvent.
sizeFilters();
439 std::vector<int>
Keys;
442 for (
unsigned int imodule=0; imodule<moduleLabels.size();
444 if (label.find(moduleLabels[imodule]) != std::string::npos) {
448 for (
unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.
filterKeys(ifilter).size(); ++ifiltrKey) {
449 Keys.push_back(triggerEvent.
filterKeys(ifilter)[ifiltrKey]);
453 if (label.find(
"hltL1s") != std::string::npos) {
454 vec[0].push_back(v4);
455 }
else if (label.find(
"PFJet") != std::string::npos) {
456 vec[2].push_back(v4);
458 vec[1].push_back(v4);
461 if (label.find(
l2Filter) != std::string::npos) {
462 vec[1].push_back(v4);
463 }
else if (label.find(
l3Filter) != std::string::npos) {
464 vec[2].push_back(v4);
465 }
else if (label.find(
l1Filter) != std::string::npos ||
467 vec[0].push_back(v4);
472 std::cout <<
"key " << ifiltrKey <<
" : pt " << TO.pt()
473 <<
" eta " << TO.eta() <<
" phi " << TO.phi()
474 <<
" mass " << TO.mass() <<
" Id " << TO.id()
480 <<
":" << vec[1].size() <<
":"
481 << vec[2].size() << std::endl;
490 for (
int lvl=1; lvl<3; lvl++) {
491 for (
unsigned int i=0;
i<vec[lvl].size();
i++) {
492 dr =
dR(vec[0][0],vec[lvl][
i]);
495 <<
" dR " << dr << std::endl;
499 mindRvec1 = vec[lvl][
i];
507 if (vec[2].
size()>0) {
513 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
514 unsigned int nTracks(0), nselTracks(0);
515 for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
516 trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
517 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
519 pTrack->
pz(), pTrack->
p());
522 std::cout <<
"This track : " << nTracks <<
" (pt/eta/phi/p) :"
523 << pTrack->
pt() <<
"/" << pTrack->
eta() <<
"/"
524 << pTrack->
phi() <<
"/" << pTrack->
p() << std::endl;
529 for (
unsigned int k=0; k<vec[2].size(); ++
k) {
530 dr =
dR(vec[2][k],v4);
533 mindRvec2 = vec[2][
k];
540 << mindRvec2 <<
" and from L1 " <<
t_mindR1 <<std::endl;
547 oneCutParameters.
maxDzPV = 100;
553 oneCutParameters.
maxDzPV = 100;
560 if (trkDetItr->okHCAL) {
566 std::cout <<
"qltyFlag|okECAL|okHCAL : " << qltyFlag <<
"|"
567 << trkDetItr->okECAL <<
"/" << trkDetItr->okHCAL
570 t_qltyFlag = (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL);
573 for (
unsigned int k=1; k<
pbin.size(); ++
k) {
582 for (
unsigned int k=1; k<
pbin.size(); ++
k) {
588 int nRH_eMipDR(0), nNearTRKs(0), nRecHits(-999);
591 trkDetItr->pointHCAL,
592 trkDetItr->pointECAL,
593 a_mipR, trkDetItr->directionECAL,
596 std::vector<DetId> ids;
599 trkDetItr->directionHCAL,nRecHits,
601 for (
unsigned int k=0; k<ids.size(); ++
k) {
602 t_DetIds->push_back(ids[k].rawId());
609 for (
unsigned int k=1; k<
pbin.size(); ++
k) {
617 for (
unsigned int k=1; k<
pbin.size(); ++
k) {
626 for (
unsigned int k=1; k<
pbin.size(); ++
k) {
638 std::cout <<
"This track : " << nTracks <<
" (pt/eta/phi/p) :"
639 << pTrack->
pt() <<
"/" << pTrack->
eta() <<
"/"
640 << pTrack->
phi() <<
"/" <<
t_p << std::endl;
646 for (
unsigned int lll=0;lll<
t_DetIds->size();lll++) {
657 for (
unsigned int k=0; k<
t_trgbits->size(); k++)
675 std::cout<<
"New trigger menu found !!!" << std::endl;
677 for (
unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
679 std::cout << triggerNames_[itrig] <<
" " << triggerindx <<
" ";
680 if (triggerindx >=
n)
681 std::cout <<
"does not exist in the current menu" << std::endl;
std::vector< int > trigPass
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
std::vector< bool > * t_trgbits
edm::InputTag triggerEvent_
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)
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const Keys & filterKeys(trigger::size_type index) const
std::vector< HBHERecHit >::const_iterator const_iterator
int bunchCrossing() const
std::vector< int > trigKount
edm::LuminosityBlockNumber_t luminosityBlock() const
std::vector< std::string > trigNames
double phi() const
azimuthal angle of momentum vector
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Strings const & triggerNames() const
std::vector< double > vbin
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
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)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
const TriggerObjectCollection & getObjects() const
double pt() const
track transverse momentum
int ieta() const
get the cell ieta
Jets made from MC generator particles.
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, bool debug=false)
static std::string const triggerResults
std::vector< double > * t_HitEnergies
double pz() const
z coordinate of momentum vector
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const edm::InputTag filterTag(trigger::size_type index) const
T const * product() const
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool debug=false)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > tok_pu_
std::string theTrackQuality
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< size_type > Keys
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< double > pbin
T const * product() const
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
spr::trackSelectionParameters selectionParameters
edm::EDGetTokenT< reco::GenJetCollection > tok_jets_
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
tuple size
Write out results.
double py() const
y coordinate of momentum vector
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_