38 : theRecHits4DLabel_(pset.getParameter<
InputTag>(
"recHits4DLabel")),
39 doTTrigCorrection_(pset.getUntrackedParameter<bool>(
"doT0SegCorrection",
false)),
40 theCalibChamber_(pset.getUntrackedParameter<
string>(
"calibChamber",
"All")),
44 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Constructor called!";
51 rootFile_ =
new TFile(rootFileName.c_str(),
"RECREATE");
60 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration]: TTrig version: " << tTrig->version() << endl;
66 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Destructor called!";
75 int selWheel, selStation, selSector;
77 linestr >> selWheel >> selStation >> selSector;
78 chosenChamberId =
DTChamberId(selWheel, selStation, selSector);
79 LogVerbatim(
"Calibration") <<
" chosen chamber " << chosenChamberId << endl;
92 for (chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt) {
94 const DTChamber* chamber = dtGeom->chamber(*chamberIdIt);
95 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
111 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
112 <<
"\nSegment global pos: " << chamber->
toGlobal((*segment).localPosition());
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;
141 for (vector<TH1F*>::const_iterator itHist = (*itChHistos).second.begin(); itHist != (*itChHistos).second.end();
154 vector<DTSuperLayerId> slIds;
160 for (vector<DTSuperLayerId>::const_iterator itSl = slIds.begin(); itSl != slIds.end(); ++itSl) {
163 float ttrigSigma = 0;
168 float ttrigMeanNew = ttrigMean;
169 float ttrigSigmaNew = ttrigSigma;
171 (itSl->superLayer() != 2) ? itChHistos->second[0]->GetMean() : itChHistos->second[1]->GetMean();
173 float kFactorNew = (kFactor * ttrigSigma + t0SegMean) / ttrigSigma;
178 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Writing ttrig object to DB!" << endl;
180 string tTrigRecord =
"DTTtrigRcd";
187 LogTrace(
"Calibration") <<
" Booking histos for Chamber: " << chId;
194 string chHistoName =
"_W" + wheel +
"_St" + station +
"_Sec" + sector;
198 histos.push_back(
new TH1F((
"hRPhiSegT0" + chHistoName).c_str(),
"t0 from Phi segments", 500, -60., 60.));
200 histos.push_back(
new TH1F((
"hRZSegT0" + chHistoName).c_str(),
"t0 from Z segments", 500, -60., 60.));
Log< level::Info, true > LogVerbatim
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)
void beginRun(const edm::Run &run, const edm::EventSetup &setup) override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
const uint16_t range(const Frame &aFrame)
ChamberHistosMap theT0SegHistoMap_
bool getData(T &iHolder) const
C::const_iterator const_iterator
constant access iterator type
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void bookHistos(DTChamberId)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
~DTTTrigOffsetCalibration() override
const DTTtrig * tTrigMap_
DTSegmentSelector * select_
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
std::string theCalibChamber_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
int station() const
Return the station number.
const edm::ESGetToken< DTTtrig, DTTtrigRcd > ttrigToken_
int wheel() const
Return the wheel number.
static void writeToDB(std::string record, T *payload)
DTTTrigOffsetCalibration(const edm::ParameterSet &pset)