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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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(), dtTPAnalyzer_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:121
DTNoiseComputation::~DTNoiseComputation ( )
virtual

Destructor.

Definition at line 393 of file DTNoiseComputation.cc.

References interactiveExample::theFile.

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

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:121
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, interpolateCardsSimple::histo, i, DTLayerId::layer(), create_public_lumi_plots::leg, Association::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  vector<const DTSuperLayer*>::const_iterator sl_it = (*chamber_it)->superLayers().begin();
336  vector<const DTSuperLayer*>::const_iterator sl_end = (*chamber_it)->superLayers().end();
337  // Loop over the SLs
338  for(; sl_it != sl_end; ++sl_it) {
339  DTSuperLayerId sl = (*sl_it)->id();
340  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
341  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
342 
343  string canvasName = "c" + getSuperLayerName(sl);
344  TCanvas c1(canvasName.c_str(),canvasName.c_str(),600,780);
345  TLegend *leg=new TLegend(0.5,0.6,0.7,0.8);
346  for(; l_it != l_end; ++l_it) {
347  DTLayerId layerId = (*l_it)->id();
348  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
349  theFile->cd();
350  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
351  if(hOccHisto){
352  string TitleHisto = "AverageNoise_" + getSuperLayerName(sl);
353  cout<<"TitleHisto : "<<TitleHisto<<endl;
354  hOccHisto->SetTitle(TitleHisto.c_str());
355  stringstream layer; layer << layerId.layer();
356  string legendHisto = "layer " + layer.str();
357  leg->AddEntry(hOccHisto,legendHisto.c_str(),"L");
358  hOccHisto->SetMaximum(getYMaximum(sl));
359  histo=true;
360  if(layerId.layer() == 1)
361  hOccHisto->Draw();
362  else
363  hOccHisto->Draw("same");
364  hOccHisto->SetLineColor(layerId.layer());
365  }
366  }
367  if(histo){
368  leg->Draw("same");
369  theNewFile->cd();
370  c1.Write();
371  }
372  }
373  histo=false;
374  }
375 
376  //write on file the noisy plots
377  for(map<pair<int,int>, TH1F*>::const_iterator nCell = noisyC.begin();
378  nCell != noisyC.end();
379  nCell++) {
380  theNewFile->cd();
381  (*nCell).second->Write();
382  }
383  for(map<pair<int,int>, TH1F*>::const_iterator somehownCell = someHowNoisyC.begin();
384  somehownCell != someHowNoisyC.end();
385  somehownCell++) {
386  theNewFile->cd();
387  (*somehownCell).second->Write();
388  }
389 
390 }
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
dictionary map
Definition: Association.py:196
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:121
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 442 of file DTNoiseComputation.cc.

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

442  {
443 
444  const DTSuperLayerId dtSLId = lId.superlayerId();
445  const DTChamberId dtChId = dtSLId.chamberId();
446  stringstream wheel; wheel << dtChId.wheel();
447  stringstream station; station << dtChId.station();
448  stringstream sector; sector << dtChId.sector();
449 
450  string ChamberName =
451  "W" + wheel.str()
452  + "_St" + station.str()
453  + "_Sec" + sector.str();
454 
455  return ChamberName;
456 
457 }
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 401 of file DTNoiseComputation.cc.

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

401  {
402 
403  const DTSuperLayerId dtSLId = lId.superlayerId();
404  const DTChamberId dtChId = dtSLId.chamberId();
405  stringstream Layer; Layer << lId.layer();
406  stringstream superLayer; superLayer << dtSLId.superlayer();
407  stringstream wheel; wheel << dtChId.wheel();
408  stringstream station; station << dtChId.station();
409  stringstream sector; sector << dtChId.sector();
410 
411  string LayerName =
412  "W" + wheel.str()
413  + "_St" + station.str()
414  + "_Sec" + sector.str()
415  + "_SL" + superLayer.str()
416  + "_L" + Layer.str();
417 
418  return LayerName;
419 
420 }
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 460 of file DTNoiseComputation.cc.

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

460  {
461 
462  int maximum=0;
463 
464  for(int SL=1; SL<=3; SL++){
465  if(!(chId.station()==4 && SL==2)){
466  for (int L=1; L<=4; L++){
467  DTLayerId layerId = DTLayerId(chId, SL, L);
468  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
469  theFile->cd();
470  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
471  if(hOccHisto){
472  if (hOccHisto->GetXaxis()->GetXmax()>maximum)
473  maximum = hOccHisto->GetXaxis()->GetNbins();
474  }
475  }
476  }
477  }
478  return maximum;
479 }
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 423 of file DTNoiseComputation.cc.

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

423  {
424 
425  const DTChamberId dtChId = dtSLId.chamberId();
426  stringstream superLayer; superLayer << dtSLId.superlayer();
427  stringstream wheel; wheel << dtChId.wheel();
428  stringstream station; station << dtChId.station();
429  stringstream sector; sector << dtChId.sector();
430 
431  string SuperLayerName =
432  "W" + wheel.str()
433  + "_St" + station.str()
434  + "_Sec" + sector.str()
435  + "_SL" + superLayer.str();
436 
437  return SuperLayerName;
438 
439 }
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 482 of file DTNoiseComputation.cc.

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

482  {
483 
484  double maximum=0;
485  double dummy = pow(10.,10.);
486 
487  for (int L=1; L<=4; L++){
488  DTLayerId layerId = DTLayerId(slId, L);
489  string HistoName = "DigiOccupancy_" + getLayerName(layerId);
490  theFile->cd();
491  TH1F *hOccHisto = (TH1F *) theFile->Get(HistoName.c_str());
492  if(hOccHisto){
493  if (hOccHisto->GetMaximum(dummy)>maximum)
494  maximum = hOccHisto->GetMaximum(dummy);
495  }
496  }
497  return maximum;
498 }
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.