38 doTTrigCorrection_(
pset.getUntrackedParameter<
bool>(
"doT0SegCorrection",
false)),
39 theCalibChamber_(
pset.getUntrackedParameter<
string>(
"calibChamber",
"All")),
43 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Constructor called!";
49 string rootFileName =
pset.getUntrackedParameter<
string>(
"rootFileName",
"DTT0SegHistos.root");
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;
90 for (chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt) {
93 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
109 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
110 <<
"\nSegment global pos: " <<
chamber->toGlobal((*segment).localPosition());
116 if ((*segment).hasPhi()) {
118 if ((segment->phiSegment()->t0()) != 0.00) {
122 if ((*segment).hasZed()) {
124 if ((segment->zSegment()->t0()) != 0.00) {
135 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Writing histos to file!" << endl;
139 for (vector<TH1F*>::const_iterator itHist = (*itChHistos).second.begin(); itHist != (*itChHistos).second.end();
152 vector<DTSuperLayerId> slIds;
158 for (vector<DTSuperLayerId>::const_iterator itSl = slIds.begin(); itSl != slIds.end(); ++itSl) {
161 float ttrigSigma = 0;
166 float ttrigMeanNew = ttrigMean;
167 float ttrigSigmaNew = ttrigSigma;
169 (itSl->superLayer() != 2) ? itChHistos->second[0]->GetMean() : itChHistos->second[1]->GetMean();
171 float kFactorNew = (
kFactor * ttrigSigma + t0SegMean) / ttrigSigma;
176 LogVerbatim(
"Calibration") <<
"[DTTTrigOffsetCalibration] Writing ttrig object to DB!" << endl;
178 string tTrigRecord =
"DTTtrigRcd";
185 LogTrace(
"Calibration") <<
" Booking histos for Chamber: " << chId;
192 string chHistoName =
"_W" +
wheel +
"_St" +
station +
"_Sec" + sector;
196 histos.push_back(
new TH1F((
"hRPhiSegT0" + chHistoName).c_str(),
"t0 from Phi segments", 500, -60., 60.));
198 histos.push_back(
new TH1F((
"hRZSegT0" + chHistoName).c_str(),
"t0 from Z segments", 500, -60., 60.));
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
std::pair< const_iterator, const_iterator > range
iterator range
static void writeToDB(std::string record, const T &payload)
void beginRun(const edm::Run &run, const edm::EventSetup &setup) override
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
std::string to_string(const V &value)
const edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DToken_
ChamberHistosMap theT0SegHistoMap_
C::const_iterator const_iterator
constant access iterator type
const bool doTTrigCorrection_
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_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
const std::string theCalibChamber_
int wheel() const
Return the wheel number.
const edm::ESGetToken< DTTtrig, DTTtrigRcd > ttrigToken_
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
DTTTrigOffsetCalibration(const edm::ParameterSet &pset)