1414
1515#include " DQMOffline/MuonDPG/interface/BaseTnPEfficiencyTask.h"
1616
17+ #include " DataFormats/GEMDigi/interface/GEMVFATStatusCollection.h"
18+ #include " DataFormats/GEMDigi/interface/GEMOHStatusCollection.h"
19+ // #include "DataFormats/GEMDigi/interface/GEMAMCStatusCollection.h"
20+
1721class GEMTnPEfficiencyTask : public BaseTnPEfficiencyTask {
1822public:
1923 // / Constructor
@@ -25,6 +29,18 @@ class GEMTnPEfficiencyTask : public BaseTnPEfficiencyTask {
2529 // / Destructor
2630 ~GEMTnPEfficiencyTask () override ;
2731
32+ const bool m_MaskChamberWithError_ = true ;
33+
34+ edm::EDGetTokenT<GEMOHStatusCollection> m_GEMOHStatusCollectionToken_ = consumes<GEMOHStatusCollection>(edm::InputTag(" muonGEMDigis" , " OHStatus" ));
35+
36+
37+ // const edm::EDGetTokenT<GEMVFATStatusCollection> m_GEMVFATStatusCollectionToken_;
38+ // const edm::EDGetTokenT<GEMAMCStatusCollection> m_GEMAMCStatusCollectionToken_;
39+ // maskChamberWithError=cms.untracked.bool(True),
40+ // ohStatusTag=cms.untracked.InputTag("muonGEMDigis", "OHStatus"),
41+ // vfatStatusTag=cms.untracked.InputTag("muonGEMDigis","VFATStatus"),
42+ // amcStatusTag=cms.untracked.InputTag("muonGEMDigis","AMCStatus"),
43+
2844protected:
2945 std::string topFolder () const override ;
3046
@@ -1296,68 +1312,32 @@ uint16_t GEMTnPEfficiencyTask::maskChamberWithError(const GEMDetId& chamber_id,
12961312 if (!oh_exists) {
12971313 oh_warning = oh_warning | 1 ;
12981314 }
1299-
1300- // VFAT Mask, OHStatus, AMC,
1301-
1302- // const bool mask = true;
1303- // bool ohst = true;
1304- // bool vfst = false;
1305- // for (auto iter = oh_status_collection->begin(); iter != oh_status_collection->end(); iter++) {
1306- // const auto [oh_id, range] = (*iter);
1307- // if (chamber_id != oh_id) {
1308- // continue;
1309- // }
1310-
1311- // for (auto oh_status = range.first; oh_status != range.second; oh_status++) {
1312- // if (oh_status->isBad()) {
1313- // // GEMOHStatus is bad. Mask this chamber.
1314- // ohst=false;
1315- // } // isBad
1316- // } // range
1317- // } // collection
1318-
1319- // for (auto iter = vfat_status_collection->begin(); iter != vfat_status_collection->end(); iter++) {
1320- // const auto [vfat_id, range] = (*iter);
1321- // if (chamber_id == vfat_id.chamberId()) {
1322- // vfst=true;
1323- // for (auto vfat_status = range.first; vfat_status != range.second; vfat_status++) {
1324- // if (vfat_status->isBad()) {
1325- // vfst=false;
1326- // }
1327- // }
1328- // } // range
1329- // } // collection
13301315 return oh_warning;
13311316}
13321317
13331318void GEMTnPEfficiencyTask::analyze (const edm::Event& event, const edm::EventSetup& context) {
13341319 BaseTnPEfficiencyTask::analyze (event, context);
1335- // std::cout << "here oh vfat status" << std::endl;
1336- // const GEMOHStatusCollection* oh_status_collection = nullptr;
13371320 GEMOHStatusCollection oh_status;
13381321 GEMVFATStatusCollection vfat_status;
13391322 edm::Handle<GEMOHStatusCollection> oh_status_collection;
13401323 edm::Handle<GEMVFATStatusCollection> vfat_status_collection;
1341- if (kMaskChamberWithError_ ) {
1342- event.getByToken (kGEMOHStatusCollectionToken_ , oh_status_collection);
1343- if (oh_status_collection .isValid ()) {
1324+ if (m_MaskChamberWithError_ ) {
1325+ event.getByToken (m_GEMOHStatusCollectionToken_ , oh_status_collection);
1326+ // if (oh_status_collem_tion .isValid()) {
13441327 oh_status = *oh_status_collection;
13451328 } else {
1346- // std::cout << "here oh fail" << std::endl;
13471329 LogTrace (" DQMOffline|MuonDPG|BaseTnPEfficiencyTask" ) << " failed to get GEMOHStatusCollection" << std::endl;
13481330 return ;
13491331 }
13501332
1351- event.getByToken (kGEMVFATStatusCollectionToken_ , vfat_status_collection);
1352- if (vfat_status_collection.isValid ()) {
1353- vfat_status = *vfat_status_collection;
1354- } else {
1355- // std::cout << "here vfat fail" << std::endl;
1356- LogTrace (" DQMOffline|MuonDPG|BaseTnPEfficiencyTask" ) << " failed to get GEMVFATStatusCollection" << std::endl;
1357- return ;
1358- }
1359- }
1360- // std::cout << "here oh vfat status passed" << std::endl;
1333+ // event.getByToken(kGEMVFATStatusCollectionToken_, vfat_status_collection);
1334+ // if (vfat_status_collection.isValid()) {
1335+ // vfat_status = *vfat_status_collection;
1336+ // } else {
1337+ // LogTrace("DQMOffline|MuonDPG|BaseTnPEfficiencyTask") << "failed to get GEMVFATStatusCollection" << std::endl;
1338+ // return;
1339+ // }
1340+ // }
13611341 edm::Handle<reco::MuonCollection> muons;
13621342 event.getByToken (m_muToken, muons);
13631343
@@ -1453,14 +1433,7 @@ void GEMTnPEfficiencyTask::analyze(const edm::Event& event, const edm::EventSetu
14531433 gem_matched = true ; // fill detailed plots if at least one GEM probe match
14541434
14551435 GEMDetId chId (chambMatch.id .rawId ());
1456- // std::cout << "kMaskChamberWithError_ : " << kMaskChamberWithError_ << std::endl;
14571436 const uint16_t warnings = maskChamberWithError (chId, &oh_status, &vfat_status);
1458- // if (has_error) {
1459- // // std::cout << "chamber has error" << std::endl;
1460- // continue;
1461- // }
1462- // std::cout << "chamber has no error" << std::endl;
1463- // }
14641437
14651438 const int roll = chId.roll ();
14661439 const int region = chId.region ();
0 commit comments