74 rootFile_ =
new TFile(rootFileName.c_str(),
"RECREATE");
107 for (dtLayerIt = digis->begin();
108 dtLayerIt != digis->end();
114 const DTLayerId layerId = (*dtLayerIt).first;
118 digi != digiRange.second;
120 const DTWireId wireId( layerId, (*digi).wire() );
122 double t0 = (*digi).countsTDC();
149 std::map<DTLayerId, TH1F*> meanHistoMap;
150 std::map<DTLayerId, TH1F*> sigmaHistoMap;
151 for(std::map<DTWireId, int>::const_iterator wireIdIt =
nDigisPerWire_.begin();
159 double mean = sumW/nDigis;
160 double rms = sumW2/nDigis - mean*
mean;
164 if(meanHistoMap.find(layerId) == meanHistoMap.end()) {
168 TH1F* meanHistoTP =
new TH1F((histoName +
"_tpMean").c_str(),
"mean from test pulses by channel",
169 nWires,firstChannel,(firstChannel + nWires));
170 TH1F* sigmaHistoTP =
new TH1F((histoName +
"_tpSigma").c_str(),
"sigma from test pulses by channel",
171 nWires,firstChannel,(firstChannel + nWires));
172 meanHistoMap[layerId] = meanHistoTP;
173 sigmaHistoMap[layerId] = sigmaHistoTP;
176 int nBin = meanHistoMap[layerId]->GetXaxis()->FindFixBin(wireId.
wire());
177 meanHistoMap[layerId]->SetBinContent(nBin,mean);
178 sigmaHistoMap[layerId]->SetBinContent(nBin,rms);
181 for(std::map<DTLayerId, TH1F*>::const_iterator
key = meanHistoMap.begin();
182 key != meanHistoMap.end(); ++
key){
183 meanHistoMap[(*key).first]->Write();
184 sigmaHistoMap[(*key).first]->Write();
191 std::stringstream theStream;
194 theStream >> histoName;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTTPAnalyzer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::map< DTWireId, double > sumWPerWire_
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos)
def setup(process, global_tag, zero_tesla=False)
std::map< DTWireId, int > nDigisPerWire_
int layer() const
Return the layer number.
DTTTrigBaseSync * tTrigSync_
int firstChannel() const
Returns the wire number of the first wire.
std::string getHistoName(const DTLayerId &)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
const DTTopology & specificTopology() const
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)
int channels() const
Returns the number of wires in the layer.
std::vector< DTDigi >::const_iterator const_iterator
void beginRun(const edm::Run &, const edm::EventSetup &) override
DTLayerId layerId() const
Return the corresponding LayerId.
std::pair< const_iterator, const_iterator > Range
edm::ESHandle< DTGeometry > dtGeom_
int station() const
Return the station number.
int wheel() const
Return the wheel number.
T get(const Candidate &c)