CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTNoiseComputation Class Reference

#include <DTNoiseComputation.h>

Inheritance diagram for DTNoiseComputation:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
void beginJob ()
 BeginJob. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &setup)
 
 DTNoiseComputation (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob ()
 Endjob. More...
 
virtual ~DTNoiseComputation ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

std::string getChamberName (const DTLayerId &lId) const
 Get the name of the chamber. More...
 
std::string getLayerName (const DTLayerId &lId) const
 Get the name of the layer. More...
 
int getMaxNumBins (const DTChamberId &chId) const
 
std::string getSuperLayerName (const DTSuperLayerId &slId) const
 Get the name of the superLayer. More...
 
double getYMaximum (const DTSuperLayerId &slId) const
 

Private Attributes

std::map< DTChamberId, TH1F * > AvNoiseIntegratedPerChamber
 
std::map< DTSuperLayerId, TH1F * > AvNoiseIntegratedPerSuperLayer
 
std::map< DTChamberId, TH1F * > AvNoisePerChamber
 
std::map< DTSuperLayerId, TH1F * > AvNoisePerSuperLayer
 
int counter
 
bool debug
 
edm::ESHandle< DTGeometrydtGeom
 
bool fastAnalysis
 
int MaxEvents
 
std::map< std::pair< int, int >
, TH1F * > 
noisyC
 
std::map< std::pair< int, int >
, TH1F * > 
someHowNoisyC
 
std::map< DTWireId, double > theAverageNoise
 
std::map< DTLayerId,
std::vector< TH2F * > > 
theEvtMap
 
TFile * theFile
 
std::map< DTWireId, TH1F * > theHistoEvtDistancePerWire
 
TFile * theNewFile
 
std::map< DTWireId, double > theTimeConstant
 
std::map< DTLayerId, bool > toComputeNoiseAverage
 
std::map< DTWireId, bool > toDel
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 37 of file DTNoiseComputation.h.

Constructor & Destructor Documentation

DTNoiseComputation::DTNoiseComputation ( const edm::ParameterSet ps)

Constructor.

Definition at line 45 of file DTNoiseComputation.cc.

References gather_cfg::cout, debug, edm::ParameterSet::getUntrackedParameter(), dtT0WireCalibration_cfg::rootFileName, and interactiveExample::theFile.

45  {
46 
47  cout << "[DTNoiseComputation]: Constructor" <<endl;
48 
49  // Get the debug parameter for verbose output
50  debug = ps.getUntrackedParameter<bool>("debug");
51 
52  // The analysis type
53  fastAnalysis = ps.getUntrackedParameter<bool>("fastAnalysis", true);
54 
55  // The root file which contain the histos
56  string rootFileName = ps.getUntrackedParameter<string>("rootFileName");
57  theFile = new TFile(rootFileName.c_str(), "READ");
58 
59  // The new root file which contain the histos
60  string newRootFileName = ps.getUntrackedParameter<string>("newRootFileName");
61  theNewFile = new TFile(newRootFileName.c_str(), "RECREATE");
62 
63  // The maximum number of events to analyze
64  MaxEvents = ps.getUntrackedParameter<int>("MaxEvents");
65 
66 }
T getUntrackedParameter(std::string const &, T const &) const
tuple cout
Definition: gather_cfg.py:41
DTNoiseComputation::~DTNoiseComputation ( )
virtual

Destructor.

Definition at line 394 of file DTNoiseComputation.cc.

References interactiveExample::theFile.

394  {
395 
396  theFile->Close();
397  theNewFile->Close();
398 
399 }

Member Function Documentation

void DTNoiseComputation::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 52 of file DTNoiseComputation.h.

52 {}
void DTNoiseComputation::beginJob ( void  )
inlinevirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file DTNoiseComputation.h.

48 {}
void DTNoiseComputation::beginRun ( const edm::Run ,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file DTNoiseComputation.cc.

References newFWLiteAna::bin, DTSuperLayerId::chamberId(), prof2calltree::count, gather_cfg::cout, debug, HcalObjRepresent::Fill(), edm::EventSetup::get(), DTChamberId::station(), relativeConstraints::station, DTLayerId::superlayerId(), interactiveExample::theFile, and DTChamberId::wheel().

69 {
70  // Get the DT Geometry
71  setup.get<MuonGeometryRecord>().get(dtGeom);
72 
73  static int count = 0;
74 
75  if(count == 0){
76  string CheckHistoName;
77 
78  TH1F *hOccHisto;
79  TH1F *hAverageNoiseHisto;
80  TH1F *hAverageNoiseIntegratedHisto;
81  TH1F *hAverageNoiseHistoPerCh;
82  TH1F *hAverageNoiseIntegratedHistoPerCh;
83  TH2F *hEvtHisto;
84  string HistoName;
85  string Histo2Name;
86  string AverageNoiseName;
87  string AverageNoiseIntegratedName;
88  string AverageNoiseNamePerCh;
89  string AverageNoiseIntegratedNamePerCh;
90  TH1F *hnoisyC;
91  TH1F *hsomeHowNoisyC;
92 
93  // Loop over all the chambers
94  vector<DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
95  vector<DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
96  // Loop over the SLs
97  for (; ch_it != ch_end; ++ch_it) {
98  DTChamberId ch = (*ch_it)->id();
99  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
100  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
101  // Loop over the SLs
102  for(; sl_it != sl_end; ++sl_it) {
103  // DTSuperLayerId sl = (*sl_it)->id();
104  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
105  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
106  // Loop over the Ls
107  for(; l_it != l_end; ++l_it) {
108  DTLayerId dtLId = (*l_it)->id();
109 
110  //check if the layer has digi
111  theFile->cd();
112  CheckHistoName = "DigiOccupancy_" + getLayerName(dtLId);
113  TH1F *hCheckHisto = (TH1F *) theFile->Get(CheckHistoName.c_str());
114  if(hCheckHisto){
115  delete hCheckHisto;
116  stringstream wheel; wheel << ch.wheel();
117  stringstream station; station << ch.station();
118 
119  if(someHowNoisyC.find(make_pair(ch.wheel(),ch.station())) == someHowNoisyC.end()) {
120  TString histoName_someHowNoisy = "somehowNoisyCell_W"+wheel.str()+"_St"+station.str();
121  hsomeHowNoisyC = new TH1F(histoName_someHowNoisy,histoName_someHowNoisy,getMaxNumBins(ch),1,getMaxNumBins(ch)+1);
122  someHowNoisyC[make_pair(ch.wheel(),ch.station())]=hsomeHowNoisyC;
123  }
124 
125  if(noisyC.find(make_pair(ch.wheel(),ch.station())) == noisyC.end()) {
126  TString histoName_noisy = "noisyCell_W"+wheel.str()+"_St"+station.str();
127  hnoisyC = new TH1F(histoName_noisy,histoName_noisy,getMaxNumBins(ch),1,getMaxNumBins(ch)+1);
128  noisyC[make_pair(ch.wheel(),ch.station())]=hnoisyC;
129  }
130 
131  //to fill a map with the average noise per wire and fill new noise histo
132  if(AvNoisePerSuperLayer.find(dtLId.superlayerId()) == AvNoisePerSuperLayer.end()) {
133  AverageNoiseName = "AverageNoise_" + getSuperLayerName(dtLId.superlayerId());
134  hAverageNoiseHisto = new TH1F(AverageNoiseName.c_str(), AverageNoiseName.c_str(), 200, 0, 10000);
135  AverageNoiseIntegratedName = "AverageNoiseIntegrated_" + getSuperLayerName(dtLId.superlayerId());
136  hAverageNoiseIntegratedHisto = new TH1F(AverageNoiseIntegratedName.c_str(), AverageNoiseIntegratedName.c_str(), 200, 0, 10000);
137  AvNoisePerSuperLayer[dtLId.superlayerId()] = hAverageNoiseHisto;
138  AvNoiseIntegratedPerSuperLayer[dtLId.superlayerId()] = hAverageNoiseIntegratedHisto;
139  if(debug){
140  cout << " New Average Noise Histo per SuperLayer : " << hAverageNoiseHisto->GetName() << endl;
141  cout << " New Average Noise Integrated Histo per SuperLayer : " << hAverageNoiseHisto->GetName() << endl;
142  }
143  }
144  if(AvNoisePerChamber.find(dtLId.superlayerId().chamberId()) == AvNoisePerChamber.end()) {
145  AverageNoiseNamePerCh = "AverageNoise_" + getChamberName(dtLId);
146  hAverageNoiseHistoPerCh = new TH1F(AverageNoiseNamePerCh.c_str(), AverageNoiseNamePerCh.c_str(), 200, 0, 10000);
147  AverageNoiseIntegratedNamePerCh = "AverageNoiseIntegrated_" + getChamberName(dtLId);
148  hAverageNoiseIntegratedHistoPerCh = new TH1F(AverageNoiseIntegratedNamePerCh.c_str(), AverageNoiseIntegratedNamePerCh.c_str(), 200, 0, 10000);
149  AvNoisePerChamber[dtLId.superlayerId().chamberId()] = hAverageNoiseHistoPerCh;
150  AvNoiseIntegratedPerChamber[dtLId.superlayerId().chamberId()] = hAverageNoiseIntegratedHistoPerCh;
151  if(debug)
152  cout << " New Average Noise Histo per chamber : " << hAverageNoiseHistoPerCh->GetName() << endl;
153  }
154 
155  HistoName = "DigiOccupancy_" + getLayerName(dtLId);
156  theFile->cd();
157  hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
158  int numBin = hOccHisto->GetXaxis()->GetNbins();
159  for (int bin=1; bin<=numBin; bin++) {
160  DTWireId wireID(dtLId, bin);
161  theAverageNoise[wireID]= hOccHisto->GetBinContent(bin);
162  if(theAverageNoise[wireID] != 0) {
163  AvNoisePerSuperLayer[dtLId.superlayerId()]->Fill(theAverageNoise[wireID]);
164  AvNoisePerChamber[dtLId.superlayerId().chamberId()]->Fill(theAverageNoise[wireID]);
165  }
166  }
167 
168  //to compute the average noise per layer (excluding the noisy cells)
169  double numCell=0;
170  double AvNoise=0;
171  HistoName = "DigiOccupancy_" + getLayerName(dtLId);
172  theFile->cd();
173  hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
174  numBin = hOccHisto->GetXaxis()->GetNbins();
175  for (int bin=1; bin<=numBin; bin++) {
176  DTWireId wireID(dtLId, bin);
177  theAverageNoise[wireID]= hOccHisto->GetBinContent(bin);
178  if(hOccHisto->GetBinContent(bin)<100){
179  numCell++;
180  AvNoise += hOccHisto->GetBinContent(bin);
181  }
182  if(hOccHisto->GetBinContent(bin)>100 && hOccHisto->GetBinContent(bin)<500){
183  someHowNoisyC[make_pair(ch.wheel(),ch.station())]->Fill(bin);
184  cout<<"filling somehow noisy cell"<<endl;
185  }
186  if(hOccHisto->GetBinContent(bin)>500){
187  noisyC[make_pair(ch.wheel(),ch.station())]->Fill(bin);
188  cout<<"filling noisy cell"<<endl;
189  }
190  }
191  AvNoise = AvNoise/numCell;
192  cout<<"theAverageNoise for layer "<<getLayerName(dtLId)<<" is : "<<AvNoise << endl;
193 
194 
195  // book the digi event plots every 1000 events
196  int updates = MaxEvents/1000;
197  for(int evt=0; evt<updates; evt++){
198  stringstream toAppend; toAppend << evt;
199  Histo2Name = "DigiPerWirePerEvent_" + getLayerName(dtLId) + "_" + toAppend.str();
200  theFile->cd();
201  hEvtHisto = (TH2F *) theFile->Get(Histo2Name.c_str());
202  if(hEvtHisto){
203  if(debug)
204  cout << " New Histo with the number of events per evt per wire: " << hEvtHisto->GetName() << endl;
205  theEvtMap[dtLId].push_back(hEvtHisto);
206  }
207  }
208 
209  }// done if the layer has digi
210  }// loop over layers
211  }// loop over superlayers
212  }// loop over chambers
213 
214  count++;
215  }
216 
217 }
int getMaxNumBins(const DTChamberId &chId) const
std::map< std::pair< int, int >, TH1F * > someHowNoisyC
DTChamberId chamberId() const
Return the corresponding ChamberId.
edm::ESHandle< DTGeometry > dtGeom
std::map< DTLayerId, std::vector< TH2F * > > theEvtMap
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
std::string getChamberName(const DTLayerId &lId) const
Get the name of the chamber.
std::map< std::pair< int, int >, TH1F * > noisyC
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< DTChamberId, TH1F * > AvNoisePerChamber
const T & get() const
Definition: EventSetup.h:55
std::map< DTSuperLayerId, TH1F * > AvNoiseIntegratedPerSuperLayer
std::string HistoName
std::string getLayerName(const DTLayerId &lId) const
Get the name of the layer.
std::map< DTSuperLayerId, TH1F * > AvNoisePerSuperLayer
std::string getSuperLayerName(const DTSuperLayerId &slId) const
Get the name of the superLayer.
std::map< DTWireId, double > theAverageNoise
tuple cout
Definition: gather_cfg.py:41
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
std::map< DTChamberId, TH1F * > AvNoiseIntegratedPerChamber
void DTNoiseComputation::endJob ( void  )
virtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 219 of file DTNoiseComputation.cc.

References newFWLiteAna::bin, alignmentValidation::c1, gather_cfg::cout, trackerHits::histo, i, DTLayerId::layer(), python.multivaluedict::map(), fitWZ::par0, and interactiveExample::theFile.

219  {
220 
221  cout << "[DTNoiseComputation] endjob called!" <<endl;
222  TH1F *hEvtDistance=0;
223  TF1 *ExpoFit = new TF1("ExpoFit","expo", 0.5, 1000.5);
224  ExpoFit->SetMarkerColor();//just silence gcc complaining about unused vars
225  TF1 *funct=0;
226  TProfile *theNoiseHisto = new TProfile("theNoiseHisto","Time Constant versus Average Noise",100000,0,100000);
227 
228 
229  //compute the time constant
230  for(map<DTLayerId, vector<TH2F*> >::const_iterator lHisto = theEvtMap.begin();
231  lHisto != theEvtMap.end();
232  lHisto++) {
233  for(int bin=1; bin<(*lHisto).second[0]->GetYaxis()->GetNbins(); bin++){
234  int distanceEvt = 1;
235  DTWireId wire((*lHisto).first, bin);
236  for(int i=0; i<int((*lHisto).second.size()); i++){
237  for(int evt=1; evt<=(*lHisto).second[i]->GetXaxis()->GetNbins(); evt++){
238  if((*lHisto).second[i]->GetBinContent(evt,bin) == 0) distanceEvt++;
239  else {
240  if(toDel.find(wire) == toDel.end()) {
241  toDel[wire] = false;
242  stringstream toAppend; toAppend << bin;
243  string Histo = "EvtDistancePerWire_" + getLayerName((*lHisto).first) + "_" + toAppend.str();
244  hEvtDistance = new TH1F(Histo.c_str(),Histo.c_str(), 50000,0.5,50000.5);
245  }
246  hEvtDistance->Fill(distanceEvt);
247  distanceEvt=1;
248  }
249  }
250  }
251  if(toDel.find(wire) != toDel.end()){
252  theHistoEvtDistancePerWire[wire] = hEvtDistance;
253  theNewFile->cd();
254  theHistoEvtDistancePerWire[wire]->Fit("ExpoFit","R");
255  funct = theHistoEvtDistancePerWire[wire]->GetFunction("ExpoFit");
256  double par0 = funct->GetParameter(0);
257  double par1 = funct->GetParameter(1);
258  cout<<"par0: "<<par0<<" par1: "<<par1<<endl;
259  double chi2rid = funct->GetChisquare()/funct->GetNDF();
260  if(chi2rid>10)
261  theTimeConstant[wire]=1;
262  else
263  theTimeConstant[wire]=par1;
264  toDel[wire] = true;
265  theHistoEvtDistancePerWire[wire]->Write();
266  delete hEvtDistance;
267  }
268  }
269  }
270 
271  if(!fastAnalysis){
272  //fill the histo with the time constant as a function of the average noise
273  for(map<DTWireId, double>::const_iterator AvNoise = theAverageNoise.begin();
274  AvNoise != theAverageNoise.end();
275  AvNoise++) {
276  DTWireId wire = (*AvNoise).first;
277  theNoiseHisto->Fill((*AvNoise).second, theTimeConstant[wire]);
278  cout<<"Layer: "<<getLayerName(wire.layerId())<<" wire: "<<wire.wire()<<endl;
279  cout<<"The Average noise: "<<(*AvNoise).second<<endl;
280  cout<<"The time constant: "<<theTimeConstant[wire]<<endl;
281  }
282  theNewFile->cd();
283  theNoiseHisto->Write();
284  }
285 
286 
287  // histos with the integrated noise per layer
288  int numBin;
289  double integratedNoise, bin, halfBin, maxBin;
290  for(map<DTSuperLayerId, TH1F*>::const_iterator AvNoiseHisto = AvNoisePerSuperLayer.begin();
291  AvNoiseHisto != AvNoisePerSuperLayer.end();
292  AvNoiseHisto++) {
293  integratedNoise=0;
294  numBin = (*AvNoiseHisto).second->GetXaxis()->GetNbins();
295  maxBin = (*AvNoiseHisto).second->GetXaxis()->GetXmax();
296  bin= double(maxBin/numBin);
297  halfBin=double(bin/2);
298  theNewFile->cd();
299  (*AvNoiseHisto).second->Write();
300  for(int i=1; i<numBin; i++){
301  integratedNoise+=(*AvNoiseHisto).second->GetBinContent(i);
302  AvNoiseIntegratedPerSuperLayer[(*AvNoiseHisto).first]->Fill(halfBin,integratedNoise);
303  halfBin+=bin;
304  }
305  theNewFile->cd();
306  AvNoiseIntegratedPerSuperLayer[(*AvNoiseHisto).first]->Write();
307  }
308  // histos with the integrated noise per chamber
309  for(map<DTChamberId, TH1F*>::const_iterator AvNoiseHisto = AvNoisePerChamber.begin();
310  AvNoiseHisto != AvNoisePerChamber.end();
311  AvNoiseHisto++) {
312  integratedNoise=0;
313  numBin = (*AvNoiseHisto).second->GetXaxis()->GetNbins();
314  maxBin = (*AvNoiseHisto).second->GetXaxis()->GetXmax();
315  bin= maxBin/numBin;
316  halfBin=bin/2;
317  theNewFile->cd();
318  (*AvNoiseHisto).second->Write();
319  for(int i=1; i<numBin; i++){
320  integratedNoise+=(*AvNoiseHisto).second->GetBinContent(i);
321  AvNoiseIntegratedPerChamber[(*AvNoiseHisto).first]->Fill(halfBin,integratedNoise);
322  halfBin+=bin;
323  }
324  theNewFile->cd();
325  AvNoiseIntegratedPerChamber[(*AvNoiseHisto).first]->Write();
326  }
327 
328 
329  //overimpose the average noise histo
330  bool histo=false;
331  vector<DTChamber*>::const_iterator chamber_it = dtGeom->chambers().begin();
332  vector<DTChamber*>::const_iterator chamber_end = dtGeom->chambers().end();
333  // Loop over the chambers
334  for (; chamber_it != chamber_end; ++chamber_it) {
335  DTChamberId ch = (*chamber_it)->id();
336  vector<const DTSuperLayer*>::const_iterator sl_it = (*chamber_it)->superLayers().begin();
337  vector<const DTSuperLayer*>::const_iterator sl_end = (*chamber_it)->superLayers().end();
338  // Loop over the SLs
339  for(; sl_it != sl_end; ++sl_it) {
340  DTSuperLayerId sl = (*sl_it)->id();
341  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
342  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
343 
344  string canvasName = "c" + getSuperLayerName(sl);
345  TCanvas c1(canvasName.c_str(),canvasName.c_str(),600,780);
346  TLegend *leg=new TLegend(0.5,0.6,0.7,0.8);
347  for(; l_it != l_end; ++l_it) {
348  DTLayerId layerId = (*l_it)->id();
349  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
350  theFile->cd();
351  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
352  if(hOccHisto){
353  string TitleHisto = "AverageNoise_" + getSuperLayerName(sl);
354  cout<<"TitleHisto : "<<TitleHisto<<endl;
355  hOccHisto->SetTitle(TitleHisto.c_str());
356  stringstream layer; layer << layerId.layer();
357  string legendHisto = "layer " + layer.str();
358  leg->AddEntry(hOccHisto,legendHisto.c_str(),"L");
359  hOccHisto->SetMaximum(getYMaximum(sl));
360  histo=true;
361  if(layerId.layer() == 1)
362  hOccHisto->Draw();
363  else
364  hOccHisto->Draw("same");
365  hOccHisto->SetLineColor(layerId.layer());
366  }
367  }
368  if(histo){
369  leg->Draw("same");
370  theNewFile->cd();
371  c1.Write();
372  }
373  }
374  histo=false;
375  }
376 
377  //write on file the noisy plots
378  for(map<pair<int,int>, TH1F*>::const_iterator nCell = noisyC.begin();
379  nCell != noisyC.end();
380  nCell++) {
381  theNewFile->cd();
382  (*nCell).second->Write();
383  }
384  for(map<pair<int,int>, TH1F*>::const_iterator somehownCell = someHowNoisyC.begin();
385  somehownCell != someHowNoisyC.end();
386  somehownCell++) {
387  theNewFile->cd();
388  (*somehownCell).second->Write();
389  }
390 
391 }
int i
Definition: DBlmapReader.cc:9
std::map< DTWireId, bool > toDel
std::map< std::pair< int, int >, TH1F * > someHowNoisyC
double getYMaximum(const DTSuperLayerId &slId) const
edm::ESHandle< DTGeometry > dtGeom
std::map< DTLayerId, std::vector< TH2F * > > theEvtMap
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
tuple histo
Definition: trackerHits.py:12
std::map< std::pair< int, int >, TH1F * > noisyC
std::map< DTWireId, TH1F * > theHistoEvtDistancePerWire
tuple par0
Definition: fitWZ.py:51
std::map< DTChamberId, TH1F * > AvNoisePerChamber
std::map< DTSuperLayerId, TH1F * > AvNoiseIntegratedPerSuperLayer
std::string HistoName
std::string getLayerName(const DTLayerId &lId) const
Get the name of the layer.
std::map< DTSuperLayerId, TH1F * > AvNoisePerSuperLayer
std::string getSuperLayerName(const DTSuperLayerId &slId) const
Get the name of the superLayer.
std::map< DTWireId, double > theAverageNoise
tuple cout
Definition: gather_cfg.py:41
std::map< DTWireId, double > theTimeConstant
std::map< DTChamberId, TH1F * > AvNoiseIntegratedPerChamber
string DTNoiseComputation::getChamberName ( const DTLayerId lId) const
private

Get the name of the chamber.

Definition at line 443 of file DTNoiseComputation.cc.

References DTSuperLayerId::chamberId(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTLayerId::superlayerId(), and DTChamberId::wheel().

443  {
444 
445  const DTSuperLayerId dtSLId = lId.superlayerId();
446  const DTChamberId dtChId = dtSLId.chamberId();
447  stringstream wheel; wheel << dtChId.wheel();
448  stringstream station; station << dtChId.station();
449  stringstream sector; sector << dtChId.sector();
450 
451  string ChamberName =
452  "W" + wheel.str()
453  + "_St" + station.str()
454  + "_Sec" + sector.str();
455 
456  return ChamberName;
457 
458 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
string DTNoiseComputation::getLayerName ( const DTLayerId lId) const
private

Get the name of the layer.

Definition at line 402 of file DTNoiseComputation.cc.

References DTSuperLayerId::chamberId(), DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), and DTChamberId::wheel().

402  {
403 
404  const DTSuperLayerId dtSLId = lId.superlayerId();
405  const DTChamberId dtChId = dtSLId.chamberId();
406  stringstream Layer; Layer << lId.layer();
407  stringstream superLayer; superLayer << dtSLId.superlayer();
408  stringstream wheel; wheel << dtChId.wheel();
409  stringstream station; station << dtChId.station();
410  stringstream sector; sector << dtChId.sector();
411 
412  string LayerName =
413  "W" + wheel.str()
414  + "_St" + station.str()
415  + "_Sec" + sector.str()
416  + "_SL" + superLayer.str()
417  + "_L" + Layer.str();
418 
419  return LayerName;
420 
421 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
int superlayer() const
Return the superlayer number (deprecated method name)
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
int DTNoiseComputation::getMaxNumBins ( const DTChamberId chId) const
private

Definition at line 461 of file DTNoiseComputation.cc.

References DTLayerId, dttmaxenums::L, DTChamberId::station(), and interactiveExample::theFile.

461  {
462 
463  int maximum=0;
464 
465  for(int SL=1; SL<=3; SL++){
466  if(!(chId.station()==4 && SL==2)){
467  for (int L=1; L<=4; L++){
468  DTLayerId layerId = DTLayerId(chId, SL, L);
469  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
470  theFile->cd();
471  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
472  if(hOccHisto){
473  if (hOccHisto->GetXaxis()->GetXmax()>maximum)
474  maximum = hOccHisto->GetXaxis()->GetNbins();
475  }
476  }
477  }
478  }
479  return maximum;
480 }
std::string HistoName
std::string getLayerName(const DTLayerId &lId) const
Get the name of the layer.
int station() const
Return the station number.
Definition: DTChamberId.h:53
string DTNoiseComputation::getSuperLayerName ( const DTSuperLayerId slId) const
private

Get the name of the superLayer.

Definition at line 424 of file DTNoiseComputation.cc.

References DTSuperLayerId::chamberId(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), and DTChamberId::wheel().

424  {
425 
426  const DTChamberId dtChId = dtSLId.chamberId();
427  stringstream superLayer; superLayer << dtSLId.superlayer();
428  stringstream wheel; wheel << dtChId.wheel();
429  stringstream station; station << dtChId.station();
430  stringstream sector; sector << dtChId.sector();
431 
432  string SuperLayerName =
433  "W" + wheel.str()
434  + "_St" + station.str()
435  + "_Sec" + sector.str()
436  + "_SL" + superLayer.str();
437 
438  return SuperLayerName;
439 
440 }
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
double DTNoiseComputation::getYMaximum ( const DTSuperLayerId slId) const
private

Definition at line 483 of file DTNoiseComputation.cc.

References DTLayerId, dttmaxenums::L, funct::pow(), and interactiveExample::theFile.

483  {
484 
485  double maximum=0;
486  double dummy = pow(10.,10.);
487 
488  for (int L=1; L<=4; L++){
489  DTLayerId layerId = DTLayerId(slId, L);
490  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
491  theFile->cd();
492  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
493  if(hOccHisto){
494  if (hOccHisto->GetMaximum(dummy)>maximum)
495  maximum = hOccHisto->GetMaximum(dummy);
496  }
497  }
498  return maximum;
499 }
std::string HistoName
std::string getLayerName(const DTLayerId &lId) const
Get the name of the layer.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

std::map<DTChamberId, TH1F*> DTNoiseComputation::AvNoiseIntegratedPerChamber
private

Definition at line 107 of file DTNoiseComputation.h.

std::map<DTSuperLayerId, TH1F*> DTNoiseComputation::AvNoiseIntegratedPerSuperLayer
private

Definition at line 113 of file DTNoiseComputation.h.

std::map<DTChamberId, TH1F*> DTNoiseComputation::AvNoisePerChamber
private

Definition at line 104 of file DTNoiseComputation.h.

std::map<DTSuperLayerId, TH1F*> DTNoiseComputation::AvNoisePerSuperLayer
private

Definition at line 110 of file DTNoiseComputation.h.

int DTNoiseComputation::counter
private

Definition at line 63 of file DTNoiseComputation.h.

bool DTNoiseComputation::debug
private

Definition at line 62 of file DTNoiseComputation.h.

edm::ESHandle<DTGeometry> DTNoiseComputation::dtGeom
private

Definition at line 68 of file DTNoiseComputation.h.

bool DTNoiseComputation::fastAnalysis
private

Definition at line 65 of file DTNoiseComputation.h.

int DTNoiseComputation::MaxEvents
private

Definition at line 64 of file DTNoiseComputation.h.

std::map< std::pair<int,int> , TH1F*> DTNoiseComputation::noisyC
private

Definition at line 122 of file DTNoiseComputation.h.

std::map< std::pair<int,int> , TH1F*> DTNoiseComputation::someHowNoisyC
private

Definition at line 125 of file DTNoiseComputation.h.

std::map<DTWireId , double> DTNoiseComputation::theAverageNoise
private

Definition at line 80 of file DTNoiseComputation.h.

std::map<DTLayerId, std::vector<TH2F*> > DTNoiseComputation::theEvtMap
private

Definition at line 83 of file DTNoiseComputation.h.

TFile* DTNoiseComputation::theFile
private

Definition at line 71 of file DTNoiseComputation.h.

std::map<DTWireId, TH1F*> DTNoiseComputation::theHistoEvtDistancePerWire
private

Definition at line 86 of file DTNoiseComputation.h.

TFile* DTNoiseComputation::theNewFile
private

Definition at line 74 of file DTNoiseComputation.h.

std::map<DTWireId , double> DTNoiseComputation::theTimeConstant
private

Definition at line 92 of file DTNoiseComputation.h.

std::map<DTLayerId , bool> DTNoiseComputation::toComputeNoiseAverage
private

Definition at line 77 of file DTNoiseComputation.h.

std::map<DTWireId , bool> DTNoiseComputation::toDel
private

Definition at line 89 of file DTNoiseComputation.h.