@@ -28,8 +28,7 @@ PFAnalyzer::PFAnalyzer(const edm::ParameterSet& pSet) {
2828 triggerResultsToken_ = consumes<edm::TriggerResults>(edm::InputTag (theTriggerResultsLabel_));
2929 m_triggerOptions = pSet.getParameter <vstring>(" TriggerNames" );
3030
31- // srcWeights = pSet.getParameter<edm::InputTag>("srcWeights");
32- // weightsToken_ = consumes<edm::ValueMap<float>>(srcWeights);
31+ // puppiWeightToken_ = consumes<edm::ValueMap<float>>(pSet.getParameter<edm::InputTag>("puppiWeight"));
3332
3433 m_pfNames = {" allPFC" , " neutralHadPFC" , " chargedHadPFC" , " electronPFC" , " muonPFC" , " gammaPFC" , " hadHFPFC" , " emHFPFC" };
3534 vertexTag_ = pSet.getParameter <edm::InputTag>(" PVCollection" );
@@ -61,6 +60,7 @@ PFAnalyzer::PFAnalyzer(const edm::ParameterSet& pSet) {
6160 m_funcMap[" eta" ] = getEta;
6261 m_funcMap[" abseta" ] = getAbsEta;
6362 m_funcMap[" phi" ] = getPhi;
63+ m_funcMap[" puppi" ] = getPuppiWeight;
6464
6565 m_funcMap[" HCalE_depth1" ] = getHcalEnergy_depth1;
6666 m_funcMap[" HCalE_depth2" ] = getHcalEnergy_depth2;
@@ -705,7 +705,6 @@ void PFAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup
705705 jets.push_back (patJets->at (i));
706706 }
707707
708- std::cout << " Using mini and pat" << std::endl;
709708 iEvent.getByToken (patPfCandidateCollection_, patPfCollection);
710709 if (!patPfCollection.isValid ()) {
711710 edm::LogError (" PFAnalyzer" ) << " invalid collection: PF candidate \n " ;
@@ -717,17 +716,18 @@ void PFAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup
717716 numPFCands = patPfCollection->size ();
718717 }
719718
720- std::cout << numPFCands << std::endl ;
721- // if(!passesTriggerSelection(jets, triggerResults, triggerNames, m_triggerOptions )){
722- // return ;
719+ // iEvent.getByToken(puppiWeightToken_, puppiWeight) ;
720+ // if(!puppiWeight.isValid( )){
721+ // edm::LogError("PFAnalyzer") << "invalid collection: Puppi weights \n" ;
723722 // }
724- //
725723
726- std::cout << " Passes trigger" << std::endl;
724+ if (!passesTriggerSelection (jets, triggerResults, triggerNames, m_triggerOptions)){
725+ return ;
726+ }
727+
727728 if (!m_eventSelectionMap[m_selection](jets)){
728729 return ;
729730 }
730- std::cout << " Passes event selection" << std::endl;
731731
732732 for (unsigned int i_pfcand=0 ; i_pfcand < numPFCands; i_pfcand++){
733733 reco::PFCandidate recoPF;
@@ -736,6 +736,7 @@ void PFAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup
736736 int partType = 0 ;
737737 if (m_isMiniAOD){
738738 packedCand = patPfCollection->at (i_pfcand);
739+
739740 partType = 1 ;
740741 } else {
741742 recoPF = pfCollection[i_pfcand];
0 commit comments