ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/src/DTDPGCreateSummary.cc
(Generate patch)

Comparing UserCode/DTDPGAnalysis/src/DTDPGCreateSummary.cc (file contents):
Revision 1.2 by battilan, Mon Nov 3 11:06:39 2008 UTC vs.
Revision 1.3 by battilan, Fri Dec 19 14:22:34 2008 UTC

# Line 81 | Line 81 | void DTDPGCreateSummary::beginJob(const
81    edm::LogVerbatim ("DTDPGSummary") << "[DTDPGCreateSummary]: BeginJob";
82    context.get<MuonGeometryRecord>().get(myMuonGeom);
83  
84 +  vector<int> emptyVector, wheelVector;
85 +  wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWhm2", emptyVector);
86 +  if (! wheelVector.empty()) mySectors[-2]=wheelVector;
87 +  wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWhm1", emptyVector);
88 +  if (! wheelVector.empty()) mySectors[-1]=wheelVector;
89 +  wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh0", emptyVector);
90 +  if (! wheelVector.empty()) mySectors[0]=wheelVector;
91 +  wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh1", emptyVector);
92 +  if (! wheelVector.empty()) mySectors[1]=wheelVector;
93 +  wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh2", emptyVector);
94 +  if (! wheelVector.empty()) mySectors[2]=wheelVector;
95 +
96 +
97   }
98  
99   void DTDPGCreateSummary::analyze(const edm::Event& e, const edm::EventSetup& context){
# Line 107 | Line 120 | void DTDPGCreateSummary::endJob(){
120  
121  
122    edm::LogVerbatim ("DTDPGSummary") << "[DTDPGCreateSummary]: Creating summaries!";
123 <  
124 <  for(int wh=-2;wh<=2;++wh) {
125 <    for(int sec=1;sec<=14;sec++) {
123 >
124 >  std::map<int,std::vector<int> >::const_iterator whIt  = mySectors.begin();
125 >  std::map<int,std::vector<int> >::const_iterator whEnd = mySectors.end();
126 >  for(;whIt!=whEnd;++whIt) {
127 >    int wh = (*whIt).first;
128 >    std::vector<int>::const_iterator secIt  = (*whIt).second.begin();
129 >    std::vector<int>::const_iterator secEnd = (*whIt).second.end();
130 >    for(;secIt!=secEnd;++secIt) {
131 >      int sec = (*secIt);
132        if (myParameters.getUntrackedParameter<bool>("DataIntegrityHistos", false))      { createDataIntegrityPlots(wh,sec); }
133        if (myParameters.getUntrackedParameter<bool>("DigiHistos", false))               { createDigiPlots(wh,sec); }
134        if (myParameters.getUntrackedParameter<bool>("RecoHistos", false))               { createRecoPlots(wh,sec); }
# Line 328 | Line 347 | void DTDPGCreateSummary::createDigiPlots
347    gStyle->SetStatW(0.29);
348    myCanvas->Clear();
349    myCanvas->Divide(3,4);
350 +  TH1F *layerOccupancy[3][4];
351 +  memset(layerOccupancy,0,12*sizeof(TH1F*));
352      
353    chDigiIt = myMuonGeom->chambers().begin();
354    chDigiEnd = myMuonGeom->chambers().end();
# Line 342 | Line 363 | void DTDPGCreateSummary::createDigiPlots
363        TH2F *histoOccupancy = (TH2F*) myFile -> Get(histoNameOccupancy.c_str());
364        if(histoOccupancy){
365          found = true;
345        TH1F *layerOccupancy[3][4];
366            
367          vector<const DTSuperLayer*>::const_iterator slIt = (*chDigiIt)->superLayers().begin();
368          vector<const DTSuperLayer*>::const_iterator slEnd = (*chDigiIt)->superLayers().end();
# Line 392 | Line 412 | void DTDPGCreateSummary::createDigiPlots
412    }
413      
414    createGifFile("Occupancies",wh,sec);
415 +
416 +  for (int i=0;i<3;++i) {
417 +    for (int j=0;j<4;++j) {
418 +      if (layerOccupancy[i][j]) {
419 +        delete layerOccupancy[i][j];
420 +      }
421 +    }
422 +  }
423      
424    // Occupancy Noise --------------------------------------------------------
425    /*
# Line 764 | Line 792 | void DTDPGCreateSummary::createRecoPlots
792          histoName4DSeg = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmXvsYInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
793        if(ch.station() == 4)
794          histoName4DSeg = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmXInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
795 <      TProfile *histo4DSeg = (TProfile*) myFile -> Get(histoName4DSeg.c_str());  // CB fissa qui non è di certo un profile!
795 >      TProfile *histo4DSeg = (TProfile*) myFile -> Get(histoName4DSeg.c_str());  // CB fix here it is not a profile
796        if(histo4DSeg){
797          int pad = (ch.station() - 1)*2 + 1;
798          myCanvas->cd(pad);
# Line 1072 | Line 1100 | void DTDPGCreateSummary::createTestPulse
1100            stringstream layer; layer << layerId.layer();
1101            string testPulsesFolder = myMainFolder + "DTTestPulsesTask/Wheel" + wheel.str();
1102            string histoName = testPulsesFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/SuperLayer" + superLayer.str() +  "/TPProfile/TestPulses2D_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str() + "_L" + layer.str();
1103 <          TProfile *histoTP = (TProfile*) myFile->Get(histoName.c_str()); // CB è un Profile???
1103 >          TProfile *histoTP = (TProfile*) myFile->Get(histoName.c_str()); // CB fix here
1104            if(histoTP){
1105              found = true;
1106              int pad = (sl.superlayer() - 1)*4 + layerId.layer();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines