@@ -9,7 +9,8 @@ L1TCaloLayer1Summary::L1TCaloLayer1Summary(const edm::ParameterSet& iConfig)
99 consumes<L1CaloRegionCollection>(iConfig.getParameter<edm::InputTag>(" caloLayer1Regions" ))),
1010 simRegionsToken_(consumes<L1CaloRegionCollection>(iConfig.getParameter<edm::InputTag>(" simRegions" ))),
1111 fedRawData_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>(" fedRawDataLabel" ))),
12- histFolder_(iConfig.getParameter<std::string>(" histFolder" )) {}
12+ histFolder_(iConfig.getParameter<std::string>(" histFolder" )) {
13+ }
1314
1415// ------------ method called for each event ------------
1516void L1TCaloLayer1Summary::analyze (const edm::Event& iEvent, const edm::EventSetup& iSetup) {
@@ -77,15 +78,21 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
7778 }
7879 }
7980
80- float caloCICADAScore = iEvent.get (caloLayer1CICADAScoreToken_)[ 0 ] ;
81+ auto caloCICADAScores = iEvent.get (caloLayer1CICADAScoreToken_);
8182 auto gtCICADAScores = iEvent.get (gtCICADAScoreToken_);
82- float simCICADAScore = iEvent.get (simCICADAScoreToken_)[ 0 ] ;
83+ auto simCICADAScores = iEvent.get (simCICADAScoreToken_);
8384
84- histoSimCICADAScore->Fill (simCICADAScore);
85- histoCaloMinusSim->Fill (caloCICADAScore - simCICADAScore);
86- histoCaloLayer1CICADAScore->Fill (caloCICADAScore);
87- histoGtCICADAScore->Fill (gtCICADAScores.at (0 , 0 ));
88- histoCaloMinusGt->Fill (gtCICADAScores.at (0 , 0 ) - caloCICADAScore);
85+ if (caloCICADAScores.size () > 0 ) {
86+ histoCaloLayer1CICADAScore->Fill (caloCICADAScores[0 ]);
87+ if (gtCICADAScores.size () > 0 ) {
88+ histoGtCICADAScore->Fill (gtCICADAScores.at (0 , 0 ));
89+ histoCaloMinusGt->Fill (caloCICADAScores[0 ] - gtCICADAScores.at (0 , 0 ));
90+ }
91+ if (simCICADAScores.size () > 0 ) {
92+ histoSimCICADAScore->Fill (simCICADAScores[0 ]);
93+ histoCaloMinusSim->Fill (caloCICADAScores[0 ] - simCICADAScores[0 ]);
94+ }
95+ }
8996}
9097
9198void L1TCaloLayer1Summary::bookHistograms (DQMStore::IBooker& ibooker, edm::Run const &, edm::EventSetup const &) {
@@ -119,7 +126,4 @@ void L1TCaloLayer1Summary::fillDescriptions(edm::ConfigurationDescriptions& desc
119126 desc.add <edm::InputTag>(" fedRawDataLabel" , edm::InputTag (" rawDataCollector" ));
120127 desc.add <std::string>(" histFolder" , " L1T/L1TCaloLayer1Summary" );
121128 descriptions.add (" l1tCaloLayer1Summary" , desc);
122- }
123-
124- // define this as a plug-in
125- DEFINE_FWK_MODULE (L1TCaloLayer1Summary);
129+ }
0 commit comments