35 labelDBRef(pset.getParameter<string>(
"labelDBRef")),
36 labelDB(pset.getParameter<string>(
"labelDB")),
37 lowerLimit(pset.getUntrackedParameter<int>(
"lowerLimit",1)),
38 higherLimit(pset.getUntrackedParameter<int>(
"higherLimit",3)),
39 outputMEsInRootFile(pset.getUntrackedParameter<bool>(
"OutputMEsInRootFile",
false)),
40 outputFileName(pset.getUntrackedParameter<string>(
"OutputFileName",
"tTrigDBMonitoring.root"))
58 const DTTtrig* DTTtrigRefMap = &*tTrig_Ref;
59 LogVerbatim(
metname) <<
"[DTtTrigDBValidation] reference Ttrig version: " << tTrig_Ref->version();
63 const DTTtrig* DTTtrigMap = &*tTrig;
64 LogVerbatim(
metname) <<
"[DTtTrigDBValidation] Ttrig to validate version: " << tTrig->version();
67 for(
int wheel=-2; wheel<=2; wheel++){
77 it != DTTtrigRefMap->
end(); ++it) {
79 (*it).first.stationId,
86 float tTrigCorr = tTrigMean + kFactor*tTrigRms;
88 <<
" Ttrig mean (ns): " << tTrigMean
89 <<
" Ttrig rms (ns): " << tTrigRms
90 <<
" Ttrig k-Factor: " << kFactor
91 <<
" Ttrig value (ns): " << tTrigCorr;
94 tTrigRefMap[slId] = pair<float,float>(tTrigCorr,tTrigRms);
99 it != DTTtrigMap->
end(); ++it) {
101 (*it).first.stationId,
102 (*it).first.sectorId,
108 float tTrigCorr = tTrigMean + kFactor*tTrigRms;
110 <<
" Ttrig mean (ns): " << tTrigMean
111 <<
" Ttrig rms (ns): " << tTrigRms
112 <<
" Ttrig k-Factor: " << kFactor
113 <<
" Ttrig value (ns): " << tTrigCorr;
116 tTrigMap[slId] = pair<float,float>(tTrigCorr,tTrigRms);
124 float difference =
tTrigMap[(*it).first].first - (*it).second.first;
127 int wheel = (*it).first.chamberId().wheel();
128 int sector = (*it).first.chamberId().sector();
131 LogTrace(
metname) <<
"Filling histos for super-layer: " << (*it).first <<
" difference: " << difference;
135 int station = (*it).first.chamberId().station();
136 if(station == 1) entry=0;
137 if(station == 2) entry=3;
138 if(station == 3) entry=6;
139 if(station == 4) entry=9;
141 int slBin = entry + (*it).first.superLayer();
142 if(slBin == 12) slBin=11;
144 tTrigDiffHistos[make_pair(wheel,sector)]->setBinContent(slBin, difference);
170 LogTrace(
metname) <<
" Booking histos for Wheel, Sector: " << wheel <<
", " << sector;
173 stringstream str_wheel; str_wheel << wheel;
174 stringstream str_sector; str_sector << sector;
176 string lHistoName =
"_W" + str_wheel.str() +
"_Sec" + str_sector.str();
182 hDifference =
dbe->
book1D(
"htTrigDifference"+lHistoName,
"difference between the two tTrig values",11,0,11);
184 pair<int,int> mypair(wheel,sector);
203 stringstream wh; wh << wheel;
206 tTrigDiffWheel[wheel] =
dbe->
book2D(
"htTrigDifference_W"+wh.str(),
"W"+wh.str()+
": summary of tTrig differences",11,1,12,14,1,15);
224 return (
int) (bin /3.1)+1;
229 if(ret == 0 || bin == 11) ret = 3;
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void endRun(edm::Run const &, edm::EventSetup const &)
const std::string metname
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
int slFromBin(int bin) const
std::vector< std::pair< DTTtrigId, DTTtrigData > >::const_iterator const_iterator
Access methods to data.
std::map< DTSuperLayerId, std::pair< float, float > > tTrigMap
std::pair< std::string, MonitorElement * > entry
edm::ESHandle< DTGeometry > dtGeom
int stationFromBin(int bin) const
virtual ~DTtTrigDBValidation()
Destructor.
DTtTrigDBValidation(const edm::ParameterSet &pset)
Constructor.
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
void beginRun(edm::Run const &, edm::EventSetup const &)
Operations.
void bookHistos(int, int)
std::map< int, MonitorElement * > tTrigDiffWheel
const_iterator begin() const
std::map< std::pair< int, int >, MonitorElement * > tTrigDiffHistos
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const_iterator end() const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)
std::string outputFileName
std::map< DTSuperLayerId, std::pair< float, float > > tTrigRefMap