41 theRecHits4DLabel_(pset.getParameter<
InputTag>(
"recHits4DLabel")),
42 doTTrigCorrection_(pset.getUntrackedParameter<bool>(
"doT0SegCorrection",
false)),
43 theCalibChamber_(pset.getUntrackedParameter<
string>(
"calibChamber",
"All")),
44 dbLabel_(pset.getUntrackedParameter<
string>(
"dbLabel",
"")) {
46 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Constructor called!";
50 rootFile_ =
new TFile(rootFileName.c_str(),
"RECREATE");
59 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration]: TTrig version: " << tTrig->version() << endl;
65 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Destructor called!";
74 int selWheel, selStation, selSector;
76 linestr >> selWheel >> selStation >> selSector;
77 chosenChamberId =
DTChamberId(selWheel, selStation, selSector);
78 LogVerbatim(
"Calibration") <<
" chosen chamber " << chosenChamberId << endl;
91 for(chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt){
94 const DTChamber* chamber = dtGeom->chamber(*chamberIdIt);
95 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
103 if((
theCalibChamber_ !=
"All") && ((*chamberIdIt) != chosenChamberId))
continue;
110 segment != range.second; ++segment){
112 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
113 <<
"\nSegment global pos: " << chamber->
toGlobal((*segment).localPosition());
115 if( !
select_(*segment, event, eventSetup) )
continue;
118 if( (*segment).hasPhi() ) {
120 if( (segment->phiSegment()->t0()) != 0.00 ){
124 if( (*segment).hasZed() ){
126 if( (segment->zSegment()->t0()) != 0.00 ){
137 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Writing histos to file!" << endl;
140 for(vector<TH1F*>::const_iterator itHist = (*itChHistos).second.begin();
141 itHist != (*itChHistos).second.end(); ++itHist) (*itHist)->Write();
151 vector<DTSuperLayerId> slIds;
156 for(vector<DTSuperLayerId>::const_iterator itSl = slIds.begin(); itSl != slIds.end(); ++itSl){
159 float ttrigSigma = 0;
164 float ttrigMeanNew = ttrigMean;
165 float ttrigSigmaNew = ttrigSigma;
166 float t0SegMean = (itSl->superLayer() != 2)?itChHistos->second[0]->GetMean():itChHistos->second[1]->GetMean();
168 float kFactorNew = (kFactor*ttrigSigma+t0SegMean)/ttrigSigma;
173 LogVerbatim(
"Calibration")<<
"[DTTTrigOffsetCalibration] Writing ttrig object to DB!" << endl;
175 string tTrigRecord =
"DTTtrigRcd";
183 LogTrace(
"Calibration") <<
" Booking histos for Chamber: " << chId;
186 stringstream wheel; wheel << chId.
wheel();
188 stringstream sector; sector << chId.
sector();
192 "_St" + station.str() +
193 "_Sec" + sector.str();
215 histos.push_back(
new TH1F((
"hRPhiSegT0"+chHistoName).c_str(),
"t0 from Phi segments", 500, -60., 60.));
216 if(chId.
station() != 4) histos.push_back(
new TH1F((
"hRZSegT0"+chHistoName).c_str(),
"t0 from Z segments", 500, -60., 60.));
virtual ~DTTTrigOffsetCalibration()
edm::InputTag theRecHits4DLabel_
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
int set(int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
ChamberHistosMap theT0SegHistoMap_
C::const_iterator const_iterator
constant access iterator type
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void bookHistos(DTChamberId)
const DTTtrig * tTrigMap_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
std::string theCalibChamber_
DTSegmentSelector select_
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
static void writeToDB(std::string record, T *payload)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
DTTTrigOffsetCalibration(const edm::ParameterSet &pset)