Skip to content

Commit

Permalink
* make the minimum number of entries of the time plots configurable
Browse files Browse the repository at this point in the history
* change the cut on the min number of entries of the time plots to fill the calib maps
  • Loading branch information
emanueledimarco committed Jun 10, 2015
1 parent 17f757d commit f669914
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions EcalTiming/plugins/EcalTimingCalibProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ class EcalTimingCalibProducer : public edm::ESProducerLooper
edm::InputTag _ecalRecHitsEETAG;
std::vector<int> _recHitFlags; ///< vector containing list of valid rec hit flags for calibration
unsigned int _recHitMin; ///< require at least this many rec hits to count the event
float _minRecHitEnergy; ///< minimum energy for the recHit to be considered for timing studies
double _minRecHitEnergy; ///< minimum energy for the recHit to be considered for timing studies
unsigned int _minEntries; ///< require a minimum number of entries in a ring to do averages
float _globalOffset; ///< time to subtract from every event
bool _produceNewCalib; ///< true if you don't want to use the values in DB and what to extract new absolute calibrations, if false iteration does not work
std::string _outputDumpFileName; ///< name of the output file for the calibration constants' dump
Expand Down Expand Up @@ -298,7 +299,8 @@ EcalTimingCalibProducer::EcalTimingCalibProducer(const edm::ParameterSet& iConfi
_ecalRecHitsEETAG(iConfig.getParameter<edm::InputTag>("recHitEECollection")),
_recHitFlags(iConfig.getParameter<std::vector<int> >("recHitFlags")),
_recHitMin(iConfig.getParameter<unsigned int>("recHitMinimumN")),
_minRecHitEnergy(iConfig.getParameter<double>("minRecHitEnergy")),
_minRecHitEnergy(iConfig.getParameter<double>("minRecHitEnergy")),
_minEntries(iConfig.getParameter<unsigned int>("minEntries")),
_globalOffset(iConfig.getParameter<double>("globalOffset")),
_produceNewCalib(iConfig.getParameter<bool>("produceNewCalib")),
_outputDumpFileName(iConfig.getParameter<std::string>("outputDumpFile")),
Expand Down Expand Up @@ -418,18 +420,15 @@ bool EcalTimingCalibProducer::addRecHit(const EcalRecHit& recHit)

void EcalTimingCalibProducer::plotRecHit(const EcalTimingEvent& recHit)
{
std::cout<<"I'm in PlotrecHit"<<std::endl;
if(recHit.detid().subdetId() == EcalBarrel) {
EBDetId id(recHit.detid());
std::cout<<"filling histos for rechit: "<<id.ieta()<<std::endl;
// Fill Rechit Energy
Event_EneMapEB_->Fill(id.ieta(), id.iphi(), recHit.energy()); // 2D energy map
Event_TimeMapEB_->Fill(id.ieta(), id.iphi(), recHit.time()); // 2D time map
RechitEnergyTimeEB->Fill(recHit.energy(), recHit.time());
} else {
// create EEDetId
EEDetId id(recHit.detid());
std::cout<<"filling histos for rechit: "<<id.ix()<<std::endl;
if(id.zside() < 0) {
Event_EneMapEEM_->Fill(id.ix(), id.iy(), recHit.energy());
Event_TimeMapEEM_->Fill(id.ix(), id.iy(), recHit.time());
Expand Down Expand Up @@ -510,9 +509,10 @@ EcalTimingCalibProducer::Status EcalTimingCalibProducer::duringLoop(const edm::E
#endif
// If we got less than the minimum recHits, continue
if(eventTimeMap_.size() < _recHitMin) return kContinue;
if(timeEB.num() < 4) return kContinue;
if(timeEEM.num() < 4 && timeEEP.num() < 4) return kContinue;
if(timeEB.num() + timeEEM.num() + timeEEP.num() < _minEntries) return kContinue;
#ifdef DEBUG
std::cout << "[DUMP]\t" << timeEB << "\t" << timeEEM << "\t" << timeEEP << std::endl;
#endif
// Make a new directory for Histograms for each event
char eventDirName[100];
if(_makeEventPlots) {
Expand All @@ -539,8 +539,7 @@ EcalTimingCalibProducer::Status EcalTimingCalibProducer::duringLoop(const edm::E
continue;
}

plotRecHit(event);
//if(_makeEventPlots) plotRecHit(event);
if(_makeEventPlots) plotRecHit(event);
_timeCalibMap[it.first].add(event);
}

Expand Down

0 comments on commit f669914

Please sign in to comment.