CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTDigiReader Class Reference

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 gather_cfg::cout, mergeVDriftHistosByStation::file, edm::ParameterSet::getUntrackedParameter(), and label.

                                                 {
    file = new TFile("DTDigiPlots.root","RECREATE");
    file->cd();
    DigiTimeBox = new TH1F("DigiTimeBox","Digi Time Box",2048,0,1600);
    DigiTimeBoxW0 = new TH1F("DigiTimeBoxW0","Digi Time Box W0",2000,0,1600);
    DigiTimeBoxW1 = new TH1F("DigiTimeBoxW1","Digi Time Box W1",2000,0,1600);
    DigiTimeBoxW2 = new TH1F("DigiTimeBoxW2","Digi Time Box W2",2000,0,1600);
    if(file->IsOpen()) cout<<"file open!"<<endl;
    else cout<<"*** Error in opening file ***"<<endl;
    label = pset.getUntrackedParameter<string>("label");
  }
virtual DTDigiReader::~DTDigiReader ( ) [inline, virtual]

Definition at line 45 of file DTDigiReader.cc.

References mergeVDriftHistosByStation::file.

                         {
    file->cd();
    DigiTimeBox->Write();
    DigiTimeBoxW0->Write();
    DigiTimeBoxW1->Write();
    DigiTimeBoxW2->Write();
    file->Close();
    //    delete file;
    // delete DigiTimeBox;
  }

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 abs, gather_cfg::cout, label, and trackerHits::simHits.

                                                                 {
    cout << "--- Run: " << event.id().run()
         << " Event: " << event.id().event() << endl;
    
    Handle<DTDigiCollection> dtDigis;
    event.getByLabel(label, dtDigis);
     // event.getByLabel("MuonDTDigis", dtDigis);
    Handle<PSimHitContainer> simHits; 
    event.getByLabel("g4SimHits","MuonDTHits",simHits);    


    DTDigiCollection::DigiRangeIterator detUnitIt;
    for (detUnitIt=dtDigis->begin();
         detUnitIt!=dtDigis->end();
         ++detUnitIt){
      
      const DTLayerId& id = (*detUnitIt).first;
      const DTDigiCollection::Range& range = (*detUnitIt).second;
      
      // DTLayerId print-out
      cout<<"--------------"<<endl;
      cout<<"id: "<<id;
      
      // Loop over the digis of this DetUnit
      for (DTDigiCollection::const_iterator digiIt = range.first;
           digiIt!=range.second;
           ++digiIt){
        //      if((*digiIt).time()<703 &&(*digiIt).time()>699) {
          cout<<" Wire: "<<(*digiIt).wire()<<endl
              <<" digi time (ns): "<<(*digiIt).time()<<endl;
          
          for(vector<PSimHit>::const_iterator simHit = simHits->begin();
              simHit != simHits->end(); simHit++){
            DTWireId wireId((*simHit).detUnitId());
            if (wireId.layerId()==id && abs((*simHit).particleType())==13){
              cout<<"entry: "<<(*simHit).entryPoint()<<endl
                  <<"exit: "<<(*simHit).exitPoint()<<endl
                  <<"TOF: "<<(*simHit).timeOfFlight()<<endl;
            }
          }

          //    }

        if(id.layer()==3)
          DigiTimeBoxW0->Fill((*digiIt).time());
        else if(abs(id.superlayer())==1)
          DigiTimeBoxW1->Fill((*digiIt).time());
        else if(abs(id.superlayer())==2)
          DigiTimeBoxW2->Fill((*digiIt).time());
        else cout<<"Error"<<endl;
        DigiTimeBox->Fill((*digiIt).time());
        
      }// for digis in layer
    }// for layers
    cout<<"--------------"<<endl;
  }

Member Data Documentation

TH1F* DTDigiReader::DigiTimeBox [private]

Definition at line 115 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW0 [private]

Definition at line 116 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW1 [private]

Definition at line 117 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW2 [private]

Definition at line 118 of file DTDigiReader.cc.

TFile* DTDigiReader::file [private]

Definition at line 119 of file DTDigiReader.cc.

string DTDigiReader::label [private]

Definition at line 114 of file DTDigiReader.cc.