66 : subtractT0_(pset.getParameter<bool>(
"subtractT0")),
67 digiLabel_(pset.getParameter<edm::
InputTag>(
"digiLabel")),
70 rootFile_ =
new TFile(rootFileName.c_str(),
"RECREATE");
94 for (dtLayerIt = digis->begin(); dtLayerIt != digis->end(); ++dtLayerIt) {
99 const DTLayerId layerId = (*dtLayerIt).first;
103 const DTWireId wireId(layerId, (*digi).wire());
105 double t0 = (*digi).countsTDC();
131 std::map<DTLayerId, TH1F*> meanHistoMap;
132 std::map<DTLayerId, TH1F*> sigmaHistoMap;
141 double mean = sumW / nDigis;
142 double rms = sumW2 / nDigis - mean *
mean;
146 if (meanHistoMap.find(layerId) == meanHistoMap.end()) {
148 const int firstChannel =
dtGeom_->layer(layerId)->specificTopology().firstChannel();
149 const int nWires =
dtGeom_->layer(layerId)->specificTopology().channels();
150 TH1F* meanHistoTP =
new TH1F((histoName +
"_tpMean").c_str(),
151 "mean from test pulses by channel",
154 (firstChannel + nWires));
155 TH1F* sigmaHistoTP =
new TH1F((histoName +
"_tpSigma").c_str(),
156 "sigma from test pulses by channel",
159 (firstChannel + nWires));
160 meanHistoMap[layerId] = meanHistoTP;
161 sigmaHistoMap[layerId] = sigmaHistoTP;
164 int nBin = meanHistoMap[layerId]->GetXaxis()->FindFixBin(wireId.
wire());
165 meanHistoMap[layerId]->SetBinContent(nBin, mean);
166 sigmaHistoMap[layerId]->SetBinContent(nBin, rms);
169 for (std::map<DTLayerId, TH1F*>::const_iterator
key = meanHistoMap.begin();
key != meanHistoMap.end(); ++
key) {
170 meanHistoMap[(*key).first]->Write();
171 sigmaHistoMap[(*key).first]->Write();
177 std::stringstream theStream;
180 theStream >> histoName;
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
DTTPAnalyzer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::map< DTWireId, double > sumWPerWire_
std::map< DTWireId, int > nDigisPerWire_
int layer() const
Return the layer number.
constexpr std::array< uint8_t, layerIndexSize > layer
std::string getHistoName(const DTLayerId &)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
tuple key
prepare the HTCondor submission files and eventually submit them
std::unique_ptr< DTTTrigBaseSync > tTrigSync_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< DTWireId, double > sumW2PerWire_
int wire() const
Return the wire number.
int superlayer() const
Return the superlayer number (deprecated method name)
std::pair< const_iterator, const_iterator > Range
T getParameter(std::string const &) const
std::vector< DigiType >::const_iterator const_iterator
DTLayerId layerId() const
Return the corresponding LayerId.
edm::ESHandle< DTGeometry > dtGeom_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
int station() const
Return the station number.
int wheel() const
Return the wheel number.