CMS 3D CMS Logo

DTDigiReader Class Reference

Analyse the the muon-drift-tubes digitizer. More...

Inheritance diagram for DTDigiReader:

edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const Event &event, const EventSetup &eventSetup)
 DTDigiReader (const ParameterSet &pset)
virtual ~DTDigiReader ()

Private Attributes

TH1F * DigiTimeBox
TH1F * DigiTimeBoxW0
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBoxW2
TFile * file
string label


Detailed Description

Analyse the the muon-drift-tubes digitizer.

Date
2006/08/01 15:24:06
Revision
1.5
Authors:
: R. Bellan

Definition at line 30 of file DTDigiReader.cc.


Constructor & Destructor Documentation

DTDigiReader::DTDigiReader ( const ParameterSet pset  )  [inline, explicit]

Definition at line 33 of file DTDigiReader.cc.

References GenMuonPlsPt100GeV_cfg::cout, DigiTimeBox, DigiTimeBoxW0, DigiTimeBoxW1, DigiTimeBoxW2, lat::endl(), file, edm::ParameterSet::getUntrackedParameter(), and label.

00033                                                  {
00034     file = new TFile("DTDigiPlots.root","RECREATE");
00035     file->cd();
00036     DigiTimeBox = new TH1F("DigiTimeBox","Digi Time Box",2048,0,1600);
00037     DigiTimeBoxW0 = new TH1F("DigiTimeBoxW0","Digi Time Box W0",2000,0,1600);
00038     DigiTimeBoxW1 = new TH1F("DigiTimeBoxW1","Digi Time Box W1",2000,0,1600);
00039     DigiTimeBoxW2 = new TH1F("DigiTimeBoxW2","Digi Time Box W2",2000,0,1600);
00040     if(file->IsOpen()) cout<<"file open!"<<endl;
00041     else cout<<"*** Error in opening file ***"<<endl;
00042     label = pset.getUntrackedParameter<string>("label");
00043   }

virtual DTDigiReader::~DTDigiReader (  )  [inline, virtual]

Definition at line 45 of file DTDigiReader.cc.

References DigiTimeBox, DigiTimeBoxW0, DigiTimeBoxW1, DigiTimeBoxW2, and file.

00045                          {
00046     file->cd();
00047     DigiTimeBox->Write();
00048     DigiTimeBoxW0->Write();
00049     DigiTimeBoxW1->Write();
00050     DigiTimeBoxW2->Write();
00051     file->Close();
00052     //    delete file;
00053     // delete DigiTimeBox;
00054   }


Member Function Documentation

void DTDigiReader::analyze ( const Event event,
const EventSetup eventSetup 
) [inline, virtual]

Implements edm::EDAnalyzer.

Definition at line 56 of file DTDigiReader.cc.

References funct::abs(), GenMuonPlsPt100GeV_cfg::cout, DigiTimeBox, DigiTimeBoxW0, DigiTimeBoxW1, DigiTimeBoxW2, lat::endl(), label, range, and trackerHits::simHits.

00056                                                                  {
00057     cout << "--- Run: " << event.id().run()
00058          << " Event: " << event.id().event() << endl;
00059     
00060     Handle<DTDigiCollection> dtDigis;
00061     event.getByLabel(label, dtDigis);
00062      // event.getByLabel("MuonDTDigis", dtDigis);
00063     Handle<PSimHitContainer> simHits; 
00064     event.getByLabel("g4SimHits","MuonDTHits",simHits);    
00065 
00066 
00067     DTDigiCollection::DigiRangeIterator detUnitIt;
00068     for (detUnitIt=dtDigis->begin();
00069          detUnitIt!=dtDigis->end();
00070          ++detUnitIt){
00071       
00072       const DTLayerId& id = (*detUnitIt).first;
00073       const DTDigiCollection::Range& range = (*detUnitIt).second;
00074       
00075       // DTLayerId print-out
00076       cout<<"--------------"<<endl;
00077       cout<<"id: "<<id;
00078       
00079       // Loop over the digis of this DetUnit
00080       for (DTDigiCollection::const_iterator digiIt = range.first;
00081            digiIt!=range.second;
00082            ++digiIt){
00083         //      if((*digiIt).time()<703 &&(*digiIt).time()>699) {
00084           cout<<" Wire: "<<(*digiIt).wire()<<endl
00085               <<" digi time (ns): "<<(*digiIt).time()<<endl;
00086           
00087           for(vector<PSimHit>::const_iterator simHit = simHits->begin();
00088               simHit != simHits->end(); simHit++){
00089             DTWireId wireId((*simHit).detUnitId());
00090             if (wireId.layerId()==id && abs((*simHit).particleType())==13){
00091               cout<<"entry: "<<(*simHit).entryPoint()<<endl
00092                   <<"exit: "<<(*simHit).exitPoint()<<endl
00093                   <<"TOF: "<<(*simHit).timeOfFlight()<<endl;
00094             }
00095           }
00096 
00097           //    }
00098 
00099         if(id.layer()==3)
00100           DigiTimeBoxW0->Fill((*digiIt).time());
00101         else if(abs(id.superlayer())==1)
00102           DigiTimeBoxW1->Fill((*digiIt).time());
00103         else if(abs(id.superlayer())==2)
00104           DigiTimeBoxW2->Fill((*digiIt).time());
00105         else cout<<"Error"<<endl;
00106         DigiTimeBox->Fill((*digiIt).time());
00107         
00108       }// for digis in layer
00109     }// for layers
00110     cout<<"--------------"<<endl;
00111   }


Member Data Documentation

TH1F* DTDigiReader::DigiTimeBox [private]

Definition at line 115 of file DTDigiReader.cc.

Referenced by analyze(), DTDigiReader(), and ~DTDigiReader().

TH1F* DTDigiReader::DigiTimeBoxW0 [private]

Definition at line 116 of file DTDigiReader.cc.

Referenced by analyze(), DTDigiReader(), and ~DTDigiReader().

TH1F* DTDigiReader::DigiTimeBoxW1 [private]

Definition at line 117 of file DTDigiReader.cc.

Referenced by analyze(), DTDigiReader(), and ~DTDigiReader().

TH1F* DTDigiReader::DigiTimeBoxW2 [private]

Definition at line 118 of file DTDigiReader.cc.

Referenced by analyze(), DTDigiReader(), and ~DTDigiReader().

TFile* DTDigiReader::file [private]

Definition at line 119 of file DTDigiReader.cc.

Referenced by DTDigiReader(), and ~DTDigiReader().

string DTDigiReader::label [private]

Definition at line 114 of file DTDigiReader.cc.

Referenced by analyze(), and DTDigiReader().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:18:50 2009 for CMSSW by  doxygen 1.5.4