Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Oct 21, 2022
1 parent 25fbe51 commit a55c704
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
Expand Up @@ -119,7 +119,7 @@ class EcalLaserAnalyzerYousi : public edm::one::EDAnalyzer<> {
//
// constructors and destructor
//
EcalLaserAnalyzerYousi::EcalLaserAnalyzerYousi(const edm::ParameterSet &iConfig)
EcalLaserAnalyzerYousi::EcalLaserAnalyzerYousi(const edm::ParameterSet &iConfig)
: hitCollection_(iConfig.getUntrackedParameter<std::string>("hitCollection")),
hitProducer_(iConfig.getUntrackedParameter<std::string>("hitProducer")),
outFileName_(iConfig.getUntrackedParameter<std::string>("outFileName")),
Expand Down Expand Up @@ -148,7 +148,7 @@ void EcalLaserAnalyzerYousi::analyze(const edm::Event &iEvent, const edm::EventS

// if ( fPN->IsOpen() ) { edm::LogInfo("EcalLaserAnalyzerYousi") <<"fPN is open in analyze OKAAAAAAAAYYY \n\n"; }

const edm::Handle<EcalRawDataCollection>& DCCHeaders = iEvent.getHandle(rawDataToken_);
const edm::Handle<EcalRawDataCollection> &DCCHeaders = iEvent.getHandle(rawDataToken_);

EcalDCCHeaderBlock::EcalDCCEventSettings settings = DCCHeaders->begin()->getEventSettings();

Expand All @@ -160,15 +160,15 @@ void EcalLaserAnalyzerYousi::analyze(const edm::Event &iEvent, const edm::EventS
return;
} //only process blue laser

const edm::Handle<EBUncalibratedRecHitCollection>& hits = iEvent.getHandle(hitToken_);

const edm::Handle<EBUncalibratedRecHitCollection> &hits = iEvent.getHandle(hitToken_);

if (!hits.isValid()) {
edm::LogError("EcalLaserAnalyzerYousi") << "Cannot get product: EBRecHitCollection from: " << hitCollection_ << " - returning.\n\n";
edm::LogError("EcalLaserAnalyzerYousi")
<< "Cannot get product: EBRecHitCollection from: " << hitCollection_ << " - returning.\n\n";
return;
}

const edm::Handle<EcalPnDiodeDigiCollection>& pndigis = iEvent.getHandle(pnDigiToken_);
const edm::Handle<EcalPnDiodeDigiCollection> &pndigis = iEvent.getHandle(pnDigiToken_);
if (!pndigis.isValid()) {
edm::LogError("EcalLaserAnalyzerYousi") << "Cannot get product: EBdigiCollection from: getHandle - returning.\n\n";
return;
Expand Down
31 changes: 21 additions & 10 deletions CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalMatacqAnalyzer.cc
Expand Up @@ -76,7 +76,6 @@ EcalMatacqAnalyzer::EcalMatacqAnalyzer(const edm::ParameterSet& iConfig)
//========================================================================
{
//now do what ever initialization is needed

}

//========================================================================
Expand Down Expand Up @@ -139,7 +138,8 @@ void EcalMatacqAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
if (_debug == 1)
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- Matacq Digis Found -- ";
} else {
edm::LogError("EcalMatacqAnalyzzer") << "Error! can't get the product EcalMatacqDigi producer:" << digiProducer_.c_str() << " collection:" << digiCollection_.c_str();
edm::LogError("EcalMatacqAnalyzzer") << "Error! can't get the product EcalMatacqDigi producer:"
<< digiProducer_.c_str() << " collection:" << digiCollection_.c_str();
return;
}

Expand All @@ -148,7 +148,9 @@ void EcalMatacqAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
const edm::Handle<EcalRawDataCollection>& pDCCHeader = e.getHandle(dccToken_);
const EcalRawDataCollection* DCCHeader = (pDCCHeader.isValid()) ? pDCCHeader.product() : nullptr;
if (!pDCCHeader.isValid()) {
edm::LogError("EcalMatacqAnalyzzer") << "Error! can't get the product EcalRawData producer:" << eventHeaderProducer_.c_str() << " collection:" << eventHeaderCollection_.c_str();
edm::LogError("EcalMatacqAnalyzzer") << "Error! can't get the product EcalRawData producer:"
<< eventHeaderProducer_.c_str()
<< " collection:" << eventHeaderCollection_.c_str();
return;
}

Expand Down Expand Up @@ -178,7 +180,8 @@ void EcalMatacqAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
event = headerItr->getLV1();

if (_debug == 1)
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- runtype:" << runType << " event:" << event << " runNum:" << runNum;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- runtype:" << runType << " event:" << event << " runNum:" << runNum;

dccID = headerItr->getDccInTCCCommand();
fedID = headerItr->fedId();
Expand All @@ -191,15 +194,19 @@ void EcalMatacqAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
return;
}
if (_debug == 1) {
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- Inside header before fed cut -- color=" << color << ", dcc=" << dccID << ", fed=" << fedID << ", lightside=" << lightside << ", runType=" << runType;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- Inside header before fed cut -- color=" << color << ", dcc=" << dccID
<< ", fed=" << fedID << ", lightside=" << lightside << ", runType=" << runType;
}

// take event only if the fed corresponds to the DCC in TCC
if (600 + dccID != fedID)
continue;

if (_debug == 1) {
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- Inside header after fed cut -- color=" << color << ", dcc=" << dccID << ", fed=" << fedID << ", lightside=" << lightside << ", runType=" << runType;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- Inside header after fed cut -- color=" << color << ", dcc=" << dccID << ", fed=" << fedID
<< ", lightside=" << lightside << ", runType=" << runType;
}

// Cut on runType
Expand Down Expand Up @@ -257,7 +264,8 @@ void EcalMatacqAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
}
}
if (_debug == 1) {
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- Inside digis -- nsamples=" << nsamples << ", max=" << max;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- Inside digis -- nsamples=" << nsamples << ", max=" << max;
}

iCh++;
Expand Down Expand Up @@ -378,7 +386,8 @@ void EcalMatacqAnalyzer::endJob() {
sliding = 0;

if (_debug == 1)
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- inside loop 1 -- jentry:" << jentry << " over nentries=" << nentries;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- inside loop 1 -- jentry:" << jentry << " over nentries=" << nentries;

// create the object for Matacq data analysis

Expand Down Expand Up @@ -439,7 +448,8 @@ void EcalMatacqAnalyzer::endJob() {

// Fill histo if there are enough samples
if (_debug == 1)
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- inside loop 7 -- firstS:" << firstS << ", nsamples:" << nsamples;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- inside loop 7 -- firstS:" << firstS << ", nsamples:" << nsamples;

if (firstS >= 0 && lastS <= nsamples) {
for (int i = firstS; i < lastS; i++) {
Expand Down Expand Up @@ -499,7 +509,8 @@ void EcalMatacqAnalyzer::endJob() {
}
}
if (_debug == 1)
edm::LogVerbatim("EcalMatacqAnalyzzer") << "-- debug test -- inside loop 8bis color:" << color << " iCol:" << iCol << " nCol:" << nCol;
edm::LogVerbatim("EcalMatacqAnalyzzer")
<< "-- debug test -- inside loop 8bis color:" << color << " iCol:" << iCol << " nCol:" << nCol;

// fill TMTQ

Expand Down
Expand Up @@ -51,7 +51,6 @@ EcalPerEvtMatacqAnalyzer::EcalPerEvtMatacqAnalyzer(const edm::ParameterSet& iCon
//========================================================================
{
//now do what ever initialization is needed

}

//========================================================================
Expand Down
Expand Up @@ -46,7 +46,6 @@ EcalStatusAnalyzer::EcalStatusAnalyzer(const edm::ParameterSet& iConfig)

{
//now do what ever initialization is needed

}

//========================================================================
Expand All @@ -72,7 +71,8 @@ void EcalStatusAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c)
const edm::Handle<EcalRawDataCollection>& pDCCHeader = e.getHandle(dccToken_);
const EcalRawDataCollection* DCCHeader = (pDCCHeader.isValid()) ? pDCCHeader.product() : nullptr;
if (!pDCCHeader.isValid()) {
edm::LogWarning("EcalStatusAnalyzer") << "Error! can't get the product retrieving DCC header " << eventHeaderCollection_.c_str();
edm::LogWarning("EcalStatusAnalyzer")
<< "Error! can't get the product retrieving DCC header " << eventHeaderCollection_.c_str();
}

// retrieving TB event header
Expand Down

0 comments on commit a55c704

Please sign in to comment.