42 theFile =
new TFile(theRootInputFile.c_str(),
"READ");
46 theFitter->setVerbosity(1);
49 theFitter->setFitSigma(sigmaFit);
58 cout <<
"[DTTTrigWriter]Constructor called!" << endl;
64 cout <<
"[DTTTrigWriter]Destructor called!" << endl;
72 cout <<
"[DTTTrigWriter]Analyzer called!" << endl;
79 const vector<const DTSuperLayer*> superLayers = dtGeom->
superLayers();
82 for (
auto sl = superLayers.begin(); sl != superLayers.end(); sl++) {
85 TH1F*
histo = (TH1F*)
theFile->Get((getTBoxName(slId)).c_str());
88 pair<double, double> meanAndSigma = theFitter->fitTimeBox(histo);
93 cout <<
" SL: " << slId <<
" mean = " << meanAndSigma.first <<
" sigma = " << meanAndSigma.second << endl;
102 cout <<
"[DTTTrigWriter]Writing ttrig object to DB!" << endl;
105 string tTrigRecord =
"DTTtrigRcd";
113 string histoName =
"Ch_" + std::to_string(slId.
wheel()) +
"_" + std::to_string(slId.
station()) +
"_" +
114 std::to_string(slId.
sector()) +
"_SL" + std::to_string(slId.
superlayer()) +
"_hTimeBox";
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Compute the ttrig by fiting the TB rising edge.
DTTTrigWriter(const edm::ParameterSet &pset)
Constructor.
std::string getTBoxName(const DTSuperLayerId &slId) const
int superlayer() const
Return the superlayer number (deprecated method name)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
static void writeToDB(std::string record, T *payload)
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
void endJob() override
Write ttrig in the DB.
~DTTTrigWriter() override
Destructor.