CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Validation/GlobalRecHits/src/GlobalRecHitsHistogrammer.cc

Go to the documentation of this file.
00001 
00010 using namespace std;
00011 #include "Validation/GlobalRecHits/interface/GlobalRecHitsHistogrammer.h"
00012 #include "DQMServices/Core/interface/DQMStore.h"
00013 #include "DQMServices/Core/interface/MonitorElement.h"
00014 
00015 GlobalRecHitsHistogrammer::GlobalRecHitsHistogrammer(const edm::ParameterSet& iPSet) :
00016   fName(""), verbosity(0), frequency(0), label(""), getAllProvenances(false),
00017   printProvenanceInfo(false), count(0)
00018 {
00019   std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
00020 
00021   // get information from parameter set
00022   fName = iPSet.getUntrackedParameter<std::string>("Name");
00023   verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
00024   frequency = iPSet.getUntrackedParameter<int>("Frequency");
00025   outputfile = iPSet.getParameter<std::string>("outputFile");
00026   doOutput = iPSet.getParameter<bool>("DoOutput");
00027   edm::ParameterSet m_Prov =
00028     iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
00029   getAllProvenances = 
00030     m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
00031   printProvenanceInfo = 
00032     m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
00033 
00034   //get Labels to use to extract information
00035   GlobalRecHitSrc_ = iPSet.getParameter<edm::InputTag>("GlobalRecHitSrc");
00036   // ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
00037   //ECalUncalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc");
00038   //ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
00039   //ECalUncalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEESrc");
00040   //ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
00041   //HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
00042   //SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc"); 
00043   //SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
00044   //MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
00045   //MuDTSimSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSimSrc");
00046   //MuCSCSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCSrc");
00047   //MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
00048   //MuRPCSimSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSimSrc");
00049 
00050   //conf_ = iPSet;
00051 
00052   // use value of first digit to determine default output level (inclusive)
00053   // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
00054   verbosity %= 10;
00055 
00056   // create persistent object
00057   // produces<PGlobalRecHit>(label);
00058 
00059   // print out Parameter Set information being used
00060   if (verbosity >= 0) {
00061     edm::LogInfo(MsgLoggerCat) 
00062       << "\n===============================\n"
00063       << "Initialized as EDProducer with parameter values:\n"
00064       << "    Name           = " << fName << "\n"
00065       << "    Verbosity      = " << verbosity << "\n"
00066       << "    Frequency      = " << frequency << "\n"
00067       << "    OutputFile     = " << outputfile << "\n"
00068       << "    DoOutput      = " << doOutput << "\n"
00069       << "    GetProv        = " << getAllProvenances << "\n"
00070       << "    PrintProv      = " << printProvenanceInfo << "\n"
00071       << "    Global Src     = " << GlobalRecHitSrc_ << "\n"
00072       << "===============================\n";
00073       
00074   }
00075   //Put in analyzer stuff here....
00076 
00077   dbe = 0;
00078 dbe = edm::Service<DQMStore>().operator->();
00079 if (dbe) {
00080     if (verbosity > 0 ) {
00081       dbe->setVerbose(1);
00082     } else {
00083       dbe->setVerbose(0);
00084     }
00085 }
00086 if (dbe) {
00087     if (verbosity > 0 ) dbe->showDirStructure();
00088   }
00089 
00090 //monitor elements 
00091 
00092 //Si Strip
00093  if(dbe)
00094    {
00095 string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5", "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2", "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3", "TOBL1", "TOBL2", "TOBL3", "TOBL4"};
00096 for(int i = 0; i<19; ++i)
00097 {
00098   mehSiStripn[i]=0;
00099   mehSiStripResX[i]=0;
00100   mehSiStripResY[i]=0;
00101 }
00102  string hcharname, hchartitle;
00103 dbe->setCurrentFolder("GlobalRecHitsV/SiStrips");
00104 for(int amend = 0; amend < 19; ++amend)
00105 { 
00106   hcharname = "hSiStripn_"+SiStripString[amend];
00107   hchartitle= SiStripString[amend]+"  rechits";
00108   mehSiStripn[amend] = dbe->book1D(hcharname,hchartitle,20,0.,20.);
00109   mehSiStripn[amend]->setAxisTitle("Number of hits in "+SiStripString[amend],1);
00110   mehSiStripn[amend]->setAxisTitle("Count",2);
00111   hcharname = "hSiStripResX_"+SiStripString[amend];
00112   hchartitle= SiStripString[amend]+" rechit x resolution";
00113   mehSiStripResX[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
00114   mehSiStripResX[amend]->setAxisTitle("X-resolution in "+SiStripString[amend],1);
00115   mehSiStripResX[amend]->setAxisTitle("Count",2);
00116   hcharname = "hSiStripResY_"+SiStripString[amend];
00117   hchartitle= SiStripString[amend]+" rechit y resolution";
00118   mehSiStripResY[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
00119   mehSiStripResY[amend]->setAxisTitle("Y-resolution in "+SiStripString[amend],1);
00120   mehSiStripResY[amend]->setAxisTitle("Count",2);
00121 }
00122 
00123 
00124 //HCal
00125 //string hcharname, hchartitle;
00126 string HCalString[4]={"HB", "HE", "HF", "HO"};
00127 float HCalnUpper[4]={3000.,3000.,3000.,2000.}; float HCalnLower[4]={2000.,2000.,2000.,1000.};
00128 for(int j =0; j <4; ++j)
00129 {
00130   mehHcaln[j]=0;
00131   mehHcalRes[j]=0;
00132 }
00133 
00134 dbe->setCurrentFolder("GlobalRecHitsV/HCals");
00135 for(int amend = 0; amend < 4; ++amend)
00136 {
00137   hcharname = "hHcaln_"+HCalString[amend];
00138   hchartitle= HCalString[amend]+"  rechits";
00139   mehHcaln[amend] = dbe->book1D(hcharname,hchartitle, 500, HCalnLower[amend], HCalnUpper[amend]);
00140   mehHcaln[amend]->setAxisTitle("Number of RecHits",1);
00141   mehHcaln[amend]->setAxisTitle("Count",2);
00142   hcharname = "hHcalRes_"+HCalString[amend];
00143   hchartitle= HCalString[amend]+"  rechit resolution";
00144   mehHcalRes[amend] = dbe->book1D(hcharname,hchartitle, 25, -2., 2.);
00145   mehHcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
00146   mehHcalRes[amend]->setAxisTitle("Count",2);
00147 }
00148 
00149 
00150 //Ecal
00151 string ECalString[3] = {"EB","EE", "ES"}; 
00152 int ECalnBins[3] = {700,100,50};
00153 float ECalnUpper[3] = {20000., 62000., 300.};
00154 float ECalnLower[3] = {6000., 60000., 100.};
00155 int ECalResBins[3] = {200,200,200};
00156 float ECalResUpper[3] = {1., 0.3, .0002};
00157 float ECalResLower[3] = {-1., -0.3, -.0002};
00158 for(int i =0; i<3; ++i)
00159 {
00160   mehEcaln[i]=0;
00161   mehEcalRes[i]=0;
00162 }
00163 dbe->setCurrentFolder("GlobalRecHitsV/ECals");
00164  
00165 for(int amend = 0; amend < 3; ++amend)
00166 {
00167   hcharname = "hEcaln_"+ECalString[amend];
00168   hchartitle= ECalString[amend]+"  rechits";
00169   mehEcaln[amend] = dbe->book1D(hcharname,hchartitle, ECalnBins[amend], ECalnLower[amend], ECalnUpper[amend]);
00170   mehEcaln[amend]->setAxisTitle("Number of RecHits",1);
00171   mehEcaln[amend]->setAxisTitle("Count",2);
00172   hcharname = "hEcalRes_"+ECalString[amend];
00173   hchartitle= ECalString[amend]+"  rechit resolution";
00174   mehEcalRes[amend] = dbe->book1D(hcharname,hchartitle,ECalResBins[amend], ECalResLower[amend], ECalResUpper[amend]);
00175   mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
00176   mehEcalRes[amend]->setAxisTitle("Count",2);
00177 }
00178 
00179 
00180 //Si Pixels
00181 string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p", "FWD2n", "FWD2p"};
00182 for(int j =0; j<7; ++j)
00183 {
00184   mehSiPixeln[j]=0;
00185   mehSiPixelResX[j]=0;
00186   mehSiPixelResY[j]=0;
00187 }
00188 
00189 dbe->setCurrentFolder("GlobalRecHitsV/SiPixels");
00190 for(int amend = 0; amend < 7; ++amend)
00191 {
00192   hcharname = "hSiPixeln_"+SiPixelString[amend];
00193   hchartitle= SiPixelString[amend]+" rechits";
00194   mehSiPixeln[amend] = dbe->book1D(hcharname,hchartitle,20,0.,20.);
00195   mehSiPixeln[amend]->setAxisTitle("Number of hits in "+SiPixelString[amend],1);
00196   mehSiPixeln[amend]->setAxisTitle("Count",2);
00197   hcharname = "hSiPixelResX_"+SiPixelString[amend];
00198   hchartitle= SiPixelString[amend]+" rechit x resolution";
00199   mehSiPixelResX[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
00200   mehSiPixelResX[amend]->setAxisTitle("X-resolution in "+SiPixelString[amend],1);
00201   mehSiPixelResX[amend]->setAxisTitle("Count",2);
00202   hcharname = "hSiPixelResY_"+SiPixelString[amend];
00203   hchartitle= SiPixelString[amend]+" rechit y resolution";
00204   
00205   mehSiPixelResY[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
00206   mehSiPixelResY[amend]->setAxisTitle("Y-resolution in "+SiPixelString[amend],1);
00207   mehSiPixelResY[amend]->setAxisTitle("Count",2);
00208 }
00209 //Muons 
00210 dbe->setCurrentFolder("GlobalRecHitsV/Muons");
00211 
00212 mehDtMuonn = 0;
00213 mehCSCn = 0;
00214 mehRPCn = 0;
00215 
00216 //std::vector<MonitorElement *> me_List = {mehDtMuonn, mehCSCn, mehRPCn};
00217 string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
00218 //float hist_prop[3] = [25., 0., 50.];
00219 string hist_string[3] = {"Dt", "CSC", "RPC"};
00220 
00221 for(int amend=0; amend<3; ++amend)
00222 {
00223   hchartitle = hist_string[amend]+" rechits";
00224   if(amend==0)
00225     {
00226   mehDtMuonn=dbe->book1D(n_List[amend],hchartitle,25, 0., 50.);
00227   mehDtMuonn->setAxisTitle("Number of Rechits",1);
00228   mehDtMuonn->setAxisTitle("Count",2);
00229     }
00230 if(amend==1)
00231     {
00232   mehCSCn=dbe->book1D(n_List[amend],hchartitle,25, 0., 50.);
00233   mehCSCn->setAxisTitle("Number of Rechits",1);
00234   mehCSCn->setAxisTitle("Count",2);
00235     }
00236 if(amend==2)
00237     {
00238   mehRPCn=dbe->book1D(n_List[amend],hchartitle,25, 0., 50.);
00239   mehRPCn->setAxisTitle("Number of Rechits",1);
00240   mehRPCn->setAxisTitle("Count",2);
00241     }
00242 }
00243 
00244 mehDtMuonRes=0;
00245 mehCSCResRDPhi=0;
00246 mehRPCResX=0;
00247 
00248 hcharname= "hDtMuonRes";
00249 hchartitle= "DT wire distance resolution";
00250 mehDtMuonRes = dbe->book1D(hcharname, hchartitle, 200, -0.2, 0.2);
00251 hcharname= "CSCResRDPhi";
00252 hchartitle= "CSC perp*dphi resolution";
00253 mehCSCResRDPhi = dbe->book1D(hcharname, hchartitle, 200, -0.2, 0.2);
00254 hcharname = "hRPCResX";
00255 hchartitle = "RPC rechits x resolution";
00256 mehRPCResX = dbe->book1D(hcharname, hchartitle, 50, -5., 5.);
00257 }
00258 
00259 }
00260 
00261 
00262 GlobalRecHitsHistogrammer::~GlobalRecHitsHistogrammer() 
00263 {
00264   if (doOutput)
00265     if (outputfile.size() != 0 && dbe) dbe->save(outputfile);
00266 }
00267 
00268 void GlobalRecHitsHistogrammer::beginJob()
00269 {
00270   return;
00271 }
00272 
00273 void GlobalRecHitsHistogrammer::endJob()
00274 {
00275   std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_endJob";
00276   if (verbosity >= 0)
00277     edm::LogInfo(MsgLoggerCat) 
00278       << "Terminating having processed " << count << " events.";
00279   return;
00280 }
00281 
00282 void GlobalRecHitsHistogrammer::analyze(const edm::Event& iEvent, 
00283                                   const edm::EventSetup& iSetup)
00284 {
00285   std::string MsgLoggerCat = "GlobalRecHitsHistogrammer_analyze";
00286 
00287   // keep track of number of events processed
00288   ++count;
00289 
00290   // get event id information
00291   int nrun = iEvent.id().run();
00292   int nevt = iEvent.id().event();
00293 
00294   if (verbosity > 0) {
00295     edm::LogInfo(MsgLoggerCat)
00296       << "Processing run " << nrun << ", event " << nevt
00297       << " (" << count << " events total)";
00298   } else if (verbosity == 0) {
00299     if (nevt%frequency == 0 || nevt == 1) {
00300       edm::LogInfo(MsgLoggerCat)
00301         << "Processing run " << nrun << ", event " << nevt
00302         << " (" << count << " events total)";
00303     }
00304   }
00305 
00306   // clear event holders
00307   //clear();  Not in example I'm using, thus I comment it out.
00308  
00309   // look at information available in the event
00310   if (getAllProvenances) {
00311 
00312     std::vector<const edm::Provenance*> AllProv;
00313     iEvent.getAllProvenance(AllProv);
00314 
00315     if (verbosity >= 0)
00316       edm::LogInfo(MsgLoggerCat)
00317         << "Number of Provenances = " << AllProv.size();
00318 
00319     if (printProvenanceInfo && (verbosity >= 0)) {
00320       TString eventout("\nProvenance info:\n");      
00321 
00322       for (unsigned int i = 0; i < AllProv.size(); ++i) {
00323         eventout += "\n       ******************************";
00324         eventout += "\n       Module       : ";
00325         //eventout += (AllProv[i]->product).moduleLabel();
00326         eventout += AllProv[i]->moduleLabel();
00327         eventout += "\n       ProductID    : ";
00328         //eventout += (AllProv[i]->product).productID_.id_;
00329         eventout += AllProv[i]->productID().id();
00330         eventout += "\n       ClassName    : ";
00331         //eventout += (AllProv[i]->product).fullClassName_;
00332         eventout += AllProv[i]->className();
00333         eventout += "\n       InstanceName : ";
00334         //eventout += (AllProv[i]->product).productInstanceName_;
00335         eventout += AllProv[i]->productInstanceName();
00336         eventout += "\n       BranchName   : ";
00337         //eventout += (AllProv[i]->product).branchName_;
00338         eventout += AllProv[i]->branchName();
00339       }
00340       eventout += "\n       ******************************\n";
00341       edm::LogInfo(MsgLoggerCat) << eventout << "\n";
00342       printProvenanceInfo = false;
00343     }
00344     getAllProvenances = false;
00345   }
00346 
00347 edm::Handle<PGlobalRecHit> srcGlobalRecHits;
00348   iEvent.getByLabel(GlobalRecHitSrc_,srcGlobalRecHits);
00349   if (!srcGlobalRecHits.isValid()) {
00350     edm::LogWarning(MsgLoggerCat)
00351       << "Unable to find PGlobalRecHit in event!";
00352     return;
00353   }
00354     
00355     int nEBCalRecHits = srcGlobalRecHits->getnEBCalRecHits();
00356     int nEECalRecHits = srcGlobalRecHits->getnEECalRecHits();
00357     int nESCalRecHits = srcGlobalRecHits->getnESCalRecHits();
00358 
00359     int nHBCalRecHits = srcGlobalRecHits->getnHBCalRecHits();
00360     int nHECalRecHits = srcGlobalRecHits->getnHECalRecHits();
00361     int nHOCalRecHits = srcGlobalRecHits->getnHOCalRecHits();
00362     int nHFCalRecHits = srcGlobalRecHits->getnHFCalRecHits();        
00363 
00364     int nTIBL1RecHits = srcGlobalRecHits->getnTIBL1RecHits();    
00365     int nTIBL2RecHits = srcGlobalRecHits->getnTIBL2RecHits();    
00366     int nTIBL3RecHits = srcGlobalRecHits->getnTIBL3RecHits();    
00367     int nTIBL4RecHits = srcGlobalRecHits->getnTIBL4RecHits();    
00368     int nTOBL1RecHits = srcGlobalRecHits->getnTOBL1RecHits();    
00369     int nTOBL2RecHits = srcGlobalRecHits->getnTOBL2RecHits();    
00370     int nTOBL3RecHits = srcGlobalRecHits->getnTOBL3RecHits();    
00371     int nTOBL4RecHits = srcGlobalRecHits->getnTOBL4RecHits();    
00372     int nTIDW1RecHits = srcGlobalRecHits->getnTIDW1RecHits();    
00373     int nTIDW2RecHits = srcGlobalRecHits->getnTIDW2RecHits();    
00374     int nTIDW3RecHits = srcGlobalRecHits->getnTIDW3RecHits();    
00375     int nTECW1RecHits = srcGlobalRecHits->getnTECW1RecHits();    
00376     int nTECW2RecHits = srcGlobalRecHits->getnTECW2RecHits();    
00377     int nTECW3RecHits = srcGlobalRecHits->getnTECW3RecHits();  
00378     int nTECW4RecHits = srcGlobalRecHits->getnTECW4RecHits();    
00379     int nTECW5RecHits = srcGlobalRecHits->getnTECW5RecHits();    
00380     int nTECW6RecHits = srcGlobalRecHits->getnTECW6RecHits();  
00381     int nTECW7RecHits = srcGlobalRecHits->getnTECW7RecHits();    
00382     int nTECW8RecHits = srcGlobalRecHits->getnTECW8RecHits();
00383 
00384     int nBRL1RecHits = srcGlobalRecHits->getnBRL1RecHits();    
00385     int nBRL2RecHits = srcGlobalRecHits->getnBRL2RecHits();    
00386     int nBRL3RecHits = srcGlobalRecHits->getnBRL3RecHits();       
00387     int nFWD1nRecHits = srcGlobalRecHits->getnFWD1nRecHits();
00388     int nFWD1pRecHits = srcGlobalRecHits->getnFWD1pRecHits();    
00389     int nFWD2nRecHits = srcGlobalRecHits->getnFWD2nRecHits();    
00390     int nFWD2pRecHits = srcGlobalRecHits->getnFWD2pRecHits(); 
00391   
00392     int nDTRecHits = srcGlobalRecHits->getnDTRecHits();  
00393 
00394     int nCSCRecHits = srcGlobalRecHits->getnCSCRecHits();
00395 
00396     int nRPCRecHits = srcGlobalRecHits->getnRPCRecHits();
00397 
00398     // get Ecal info
00399     std::vector<PGlobalRecHit::ECalRecHit> EECalRecHits = 
00400       srcGlobalRecHits->getEECalRecHits();
00401     mehEcaln[0]->Fill((float)nEECalRecHits);
00402     for (unsigned int i = 0; i < EECalRecHits.size(); ++i) {
00403       mehEcalRes[0]->Fill(EECalRecHits[i].RE - EECalRecHits[i].SHE);
00404     }
00405     
00406     std::vector<PGlobalRecHit::ECalRecHit> EBCalRecHits = 
00407       srcGlobalRecHits->getEBCalRecHits();
00408     mehEcaln[1]->Fill((float)nEBCalRecHits);
00409     for (unsigned int i = 0; i < EBCalRecHits.size(); ++i) {
00410       mehEcalRes[1]->Fill(EBCalRecHits[i].RE - EBCalRecHits[i].SHE);
00411     }
00412 
00413     std::vector<PGlobalRecHit::ECalRecHit> ESCalRecHits = 
00414       srcGlobalRecHits->getESCalRecHits();
00415     mehEcaln[2]->Fill((float)nESCalRecHits);
00416     for (unsigned int i = 0; i < ESCalRecHits.size(); ++i) {
00417       mehEcalRes[2]->Fill(ESCalRecHits[i].RE - ESCalRecHits[i].SHE);
00418     }
00419 
00420     // Get HCal info
00421     std::vector<PGlobalRecHit::HCalRecHit> HBCalRecHits = 
00422       srcGlobalRecHits->getHBCalRecHits();
00423     mehHcaln[0]->Fill((float)nHBCalRecHits);
00424     for (unsigned int i = 0; i < HBCalRecHits.size(); ++i) {
00425       mehHcalRes[0]->Fill(HBCalRecHits[i].REC - HBCalRecHits[i].SHE); 
00426     }
00427 
00428     std::vector<PGlobalRecHit::HCalRecHit> HECalRecHits = 
00429       srcGlobalRecHits->getHECalRecHits();
00430     mehHcaln[1]->Fill((float)nHECalRecHits);
00431     for (unsigned int i = 0; i < HECalRecHits.size(); ++i) {
00432       mehHcalRes[1]->Fill(HECalRecHits[i].REC - HECalRecHits[i].SHE); 
00433     }
00434 
00435     std::vector<PGlobalRecHit::HCalRecHit> HOCalRecHits = 
00436       srcGlobalRecHits->getHOCalRecHits();
00437     mehHcaln[2]->Fill((float)nHOCalRecHits);
00438     for (unsigned int i = 0; i < HOCalRecHits.size(); ++i) {
00439       mehHcalRes[2]->Fill(HOCalRecHits[i].REC - HOCalRecHits[i].SHE); 
00440     }
00441 
00442     std::vector<PGlobalRecHit::HCalRecHit> HFCalRecHits = 
00443       srcGlobalRecHits->getHFCalRecHits();
00444     mehHcaln[3]->Fill((float)nHFCalRecHits);
00445     for (unsigned int i = 0; i < HFCalRecHits.size(); ++i) {
00446       mehHcalRes[3]->Fill(HFCalRecHits[i].REC - HFCalRecHits[i].SHE); 
00447     }
00448 
00449     // get SiStrip info
00450     std::vector<PGlobalRecHit::SiStripRecHit> TIBL1RecHits =
00451       srcGlobalRecHits->getTIBL1RecHits();      
00452     mehSiStripn[0]->Fill((float)nTIBL1RecHits);
00453     for (unsigned int i = 0; i < TIBL1RecHits.size(); ++i) {
00454       mehSiStripResX[0]->Fill(TIBL1RecHits[i].RX - TIBL1RecHits[i].SX);
00455       mehSiStripResY[0]->Fill(TIBL1RecHits[i].RY - TIBL1RecHits[i].SY);
00456     }
00457 
00458     std::vector<PGlobalRecHit::SiStripRecHit> TIBL2RecHits =
00459       srcGlobalRecHits->getTIBL2RecHits();      
00460     mehSiStripn[1]->Fill((float)nTIBL2RecHits);
00461     for (unsigned int i = 0; i < TIBL2RecHits.size(); ++i) {
00462       mehSiStripResX[1]->Fill(TIBL2RecHits[i].RX - TIBL2RecHits[i].SX);
00463       mehSiStripResY[1]->Fill(TIBL2RecHits[i].RY - TIBL2RecHits[i].SY);
00464     }
00465 
00466     std::vector<PGlobalRecHit::SiStripRecHit> TIBL3RecHits =
00467       srcGlobalRecHits->getTIBL3RecHits();      
00468     mehSiStripn[2]->Fill((float)nTIBL3RecHits);
00469     for (unsigned int i = 0; i < TIBL3RecHits.size(); ++i) {
00470       mehSiStripResX[2]->Fill(TIBL3RecHits[i].RX - TIBL3RecHits[i].SX);
00471       mehSiStripResY[2]->Fill(TIBL3RecHits[i].RY - TIBL3RecHits[i].SY);
00472     }
00473 
00474     std::vector<PGlobalRecHit::SiStripRecHit> TIBL4RecHits =
00475       srcGlobalRecHits->getTIBL4RecHits();      
00476     mehSiStripn[3]->Fill((float)nTIBL4RecHits);
00477     for (unsigned int i = 0; i < TIBL4RecHits.size(); ++i) {
00478       mehSiStripResX[3]->Fill(TIBL4RecHits[i].RX - TIBL4RecHits[i].SX);
00479       mehSiStripResY[3]->Fill(TIBL4RecHits[i].RY - TIBL4RecHits[i].SY);
00480     }
00481 
00482     std::vector<PGlobalRecHit::SiStripRecHit> TOBL1RecHits =
00483       srcGlobalRecHits->getTOBL1RecHits();      
00484     mehSiStripn[4]->Fill((float)nTOBL1RecHits);
00485     for (unsigned int i = 0; i < TOBL1RecHits.size(); ++i) {
00486       mehSiStripResX[4]->Fill(TOBL1RecHits[i].RX - TOBL1RecHits[i].SX);
00487       mehSiStripResY[4]->Fill(TOBL1RecHits[i].RY - TOBL1RecHits[i].SY);
00488     }
00489 
00490     std::vector<PGlobalRecHit::SiStripRecHit> TOBL2RecHits =
00491       srcGlobalRecHits->getTOBL2RecHits();      
00492     mehSiStripn[5]->Fill((float)nTOBL2RecHits);
00493     for (unsigned int i = 0; i < TOBL2RecHits.size(); ++i) {
00494       mehSiStripResX[5]->Fill(TOBL2RecHits[i].RX - TOBL2RecHits[i].SX);
00495       mehSiStripResY[5]->Fill(TOBL2RecHits[i].RY - TOBL2RecHits[i].SY);
00496     }
00497 
00498     std::vector<PGlobalRecHit::SiStripRecHit> TOBL3RecHits =
00499       srcGlobalRecHits->getTOBL3RecHits();      
00500     mehSiStripn[6]->Fill((float)nTOBL3RecHits);
00501     for (unsigned int i = 0; i < TOBL3RecHits.size(); ++i) {
00502       mehSiStripResX[6]->Fill(TOBL3RecHits[i].RX - TOBL3RecHits[i].SX);
00503       mehSiStripResY[6]->Fill(TOBL3RecHits[i].RY - TOBL3RecHits[i].SY);
00504     }
00505 
00506     std::vector<PGlobalRecHit::SiStripRecHit> TOBL4RecHits =
00507       srcGlobalRecHits->getTOBL4RecHits();      
00508     mehSiStripn[7]->Fill((float)nTOBL4RecHits);
00509     for (unsigned int i = 0; i < TOBL4RecHits.size(); ++i) {
00510       mehSiStripResX[7]->Fill(TOBL4RecHits[i].RX - TOBL4RecHits[i].SX);
00511       mehSiStripResY[7]->Fill(TOBL4RecHits[i].RY - TOBL4RecHits[i].SY);
00512     }
00513 
00514     std::vector<PGlobalRecHit::SiStripRecHit> TIDW1RecHits =
00515       srcGlobalRecHits->getTIDW1RecHits();      
00516     mehSiStripn[8]->Fill((float)nTIDW1RecHits);
00517     for (unsigned int i = 0; i < TIDW1RecHits.size(); ++i) {
00518       mehSiStripResX[8]->Fill(TIDW1RecHits[i].RX - TIDW1RecHits[i].SX);
00519       mehSiStripResY[8]->Fill(TIDW1RecHits[i].RY - TIDW1RecHits[i].SY);
00520     }
00521 
00522     std::vector<PGlobalRecHit::SiStripRecHit> TIDW2RecHits =
00523       srcGlobalRecHits->getTIDW2RecHits();      
00524     mehSiStripn[9]->Fill((float)nTIDW2RecHits);
00525     for (unsigned int i = 0; i < TIDW2RecHits.size(); ++i) {
00526       mehSiStripResX[9]->Fill(TIDW2RecHits[i].RX - TIDW2RecHits[i].SX);
00527       mehSiStripResY[9]->Fill(TIDW2RecHits[i].RY - TIDW2RecHits[i].SY);
00528     }
00529 
00530     std::vector<PGlobalRecHit::SiStripRecHit> TIDW3RecHits =
00531       srcGlobalRecHits->getTIDW3RecHits();      
00532     mehSiStripn[10]->Fill((float)nTIDW3RecHits);
00533     for (unsigned int i = 0; i < TIDW3RecHits.size(); ++i) {
00534       mehSiStripResX[10]->Fill(TIDW3RecHits[i].RX - TIDW3RecHits[i].SX);
00535       mehSiStripResY[10]->Fill(TIDW3RecHits[i].RY - TIDW3RecHits[i].SY);
00536     }
00537 
00538     std::vector<PGlobalRecHit::SiStripRecHit> TECW1RecHits =
00539       srcGlobalRecHits->getTECW1RecHits();      
00540     mehSiStripn[11]->Fill((float)nTECW1RecHits);
00541     for (unsigned int i = 0; i < TECW1RecHits.size(); ++i) {
00542       mehSiStripResX[11]->Fill(TECW1RecHits[i].RX - TECW1RecHits[i].SX);
00543       mehSiStripResY[11]->Fill(TECW1RecHits[i].RY - TECW1RecHits[i].SY);
00544     }
00545 
00546     std::vector<PGlobalRecHit::SiStripRecHit> TECW2RecHits =
00547       srcGlobalRecHits->getTECW2RecHits();      
00548     mehSiStripn[12]->Fill((float)nTECW2RecHits);
00549     for (unsigned int i = 0; i < TECW2RecHits.size(); ++i) {
00550       mehSiStripResX[12]->Fill(TECW2RecHits[i].RX - TECW2RecHits[i].SX);
00551       mehSiStripResY[12]->Fill(TECW2RecHits[i].RY - TECW2RecHits[i].SY);
00552     }
00553 
00554     std::vector<PGlobalRecHit::SiStripRecHit> TECW3RecHits =
00555       srcGlobalRecHits->getTECW3RecHits();      
00556     mehSiStripn[13]->Fill((float)nTECW3RecHits);
00557     for (unsigned int i = 0; i < TECW3RecHits.size(); ++i) {
00558       mehSiStripResX[13]->Fill(TECW3RecHits[i].RX - TECW3RecHits[i].SX);
00559       mehSiStripResY[13]->Fill(TECW3RecHits[i].RY - TECW3RecHits[i].SY);
00560     }
00561 
00562     std::vector<PGlobalRecHit::SiStripRecHit> TECW4RecHits =
00563       srcGlobalRecHits->getTECW4RecHits();      
00564     mehSiStripn[14]->Fill((float)nTECW4RecHits);
00565     for (unsigned int i = 0; i < TECW4RecHits.size(); ++i) {
00566       mehSiStripResX[14]->Fill(TECW4RecHits[i].RX - TECW4RecHits[i].SX);
00567       mehSiStripResY[14]->Fill(TECW4RecHits[i].RY - TECW4RecHits[i].SY);
00568     }
00569 
00570     std::vector<PGlobalRecHit::SiStripRecHit> TECW5RecHits =
00571       srcGlobalRecHits->getTECW5RecHits();      
00572     mehSiStripn[15]->Fill((float)nTECW5RecHits);
00573     for (unsigned int i = 0; i < TECW5RecHits.size(); ++i) {
00574       mehSiStripResX[15]->Fill(TECW5RecHits[i].RX - TECW5RecHits[i].SX);
00575       mehSiStripResY[15]->Fill(TECW5RecHits[i].RY - TECW5RecHits[i].SY);
00576     }
00577 
00578     std::vector<PGlobalRecHit::SiStripRecHit> TECW6RecHits =
00579       srcGlobalRecHits->getTECW6RecHits();      
00580     mehSiStripn[16]->Fill((float)nTECW6RecHits);
00581     for (unsigned int i = 0; i < TECW6RecHits.size(); ++i) {
00582       mehSiStripResX[16]->Fill(TECW6RecHits[i].RX - TECW6RecHits[i].SX);
00583       mehSiStripResY[16]->Fill(TECW6RecHits[i].RY - TECW6RecHits[i].SY);
00584     }
00585 
00586     std::vector<PGlobalRecHit::SiStripRecHit> TECW7RecHits =
00587       srcGlobalRecHits->getTECW7RecHits();      
00588     mehSiStripn[17]->Fill((float)nTECW7RecHits);
00589     for (unsigned int i = 0; i < TECW7RecHits.size(); ++i) {
00590       mehSiStripResX[17]->Fill(TECW7RecHits[i].RX - TECW7RecHits[i].SX);
00591       mehSiStripResY[17]->Fill(TECW7RecHits[i].RY - TECW7RecHits[i].SY);
00592     }
00593 
00594     std::vector<PGlobalRecHit::SiStripRecHit> TECW8RecHits =
00595       srcGlobalRecHits->getTECW8RecHits();      
00596     mehSiStripn[18]->Fill((float)nTECW8RecHits);
00597     for (unsigned int i = 0; i < TECW8RecHits.size(); ++i) {
00598       mehSiStripResX[18]->Fill(TECW8RecHits[i].RX - TECW8RecHits[i].SX);
00599       mehSiStripResY[18]->Fill(TECW8RecHits[i].RY - TECW8RecHits[i].SY);
00600     }
00601 
00602     // get SiPixel info
00603     std::vector<PGlobalRecHit::SiPixelRecHit> BRL1RecHits =
00604       srcGlobalRecHits->getBRL1RecHits();      
00605     mehSiPixeln[0]->Fill((float)nBRL1RecHits);
00606     for (unsigned int i = 0; i < BRL1RecHits.size(); ++i) {
00607       mehSiPixelResX[0]->Fill(BRL1RecHits[i].RX - BRL1RecHits[i].SX);
00608       mehSiPixelResY[0]->Fill(BRL1RecHits[i].RY - BRL1RecHits[i].SY);
00609     }
00610 
00611     std::vector<PGlobalRecHit::SiPixelRecHit> BRL2RecHits =
00612       srcGlobalRecHits->getBRL2RecHits();      
00613     mehSiPixeln[1]->Fill((float)nBRL2RecHits);
00614     for (unsigned int i = 0; i < BRL2RecHits.size(); ++i) {
00615       mehSiPixelResX[1]->Fill(BRL2RecHits[i].RX - BRL2RecHits[i].SX);
00616       mehSiPixelResY[1]->Fill(BRL2RecHits[i].RY - BRL2RecHits[i].SY);
00617     }
00618 
00619     std::vector<PGlobalRecHit::SiPixelRecHit> BRL3RecHits =
00620       srcGlobalRecHits->getBRL3RecHits();      
00621     mehSiPixeln[2]->Fill((float)nBRL3RecHits);
00622     for (unsigned int i = 0; i < BRL3RecHits.size(); ++i) {
00623       mehSiPixelResX[2]->Fill(BRL3RecHits[i].RX - BRL3RecHits[i].SX);
00624       mehSiPixelResY[2]->Fill(BRL3RecHits[i].RY - BRL3RecHits[i].SY);
00625    }
00626 
00627     std::vector<PGlobalRecHit::SiPixelRecHit> FWD1pRecHits =
00628       srcGlobalRecHits->getFWD1pRecHits();      
00629     mehSiPixeln[3]->Fill((float)nFWD1pRecHits);
00630     for (unsigned int i = 0; i < FWD1pRecHits.size(); ++i) {
00631       mehSiPixelResX[3]->Fill(FWD1pRecHits[i].RX - FWD1pRecHits[i].SX);
00632       mehSiPixelResY[3]->Fill(FWD1pRecHits[i].RY - FWD1pRecHits[i].SY);
00633     }
00634 
00635     std::vector<PGlobalRecHit::SiPixelRecHit> FWD1nRecHits =
00636       srcGlobalRecHits->getFWD1nRecHits();      
00637     mehSiPixeln[4]->Fill((float)nFWD1nRecHits);
00638     for (unsigned int i = 0; i < FWD1nRecHits.size(); ++i) {
00639       mehSiPixelResX[4]->Fill(FWD1nRecHits[i].RX - FWD1nRecHits[i].SX);
00640       mehSiPixelResY[4]->Fill(FWD1nRecHits[i].RY - FWD1nRecHits[i].SY);
00641     }
00642 
00643     std::vector<PGlobalRecHit::SiPixelRecHit> FWD2pRecHits =
00644       srcGlobalRecHits->getFWD2pRecHits();      
00645     mehSiPixeln[5]->Fill((float)nFWD2pRecHits);
00646     for (unsigned int i = 0; i < FWD2pRecHits.size(); ++i) {
00647       mehSiPixelResX[5]->Fill(FWD2pRecHits[i].RX - FWD2pRecHits[i].SX);
00648       mehSiPixelResY[5]->Fill(FWD2pRecHits[i].RY - FWD2pRecHits[i].SY);
00649     }
00650 
00651     std::vector<PGlobalRecHit::SiPixelRecHit> FWD2nRecHits =
00652       srcGlobalRecHits->getFWD2nRecHits();      
00653     mehSiPixeln[6]->Fill((float)nFWD2nRecHits);
00654     for (unsigned int i = 0; i < FWD2nRecHits.size(); ++i) {
00655       mehSiPixelResX[6]->Fill(FWD2nRecHits[i].RX - FWD2nRecHits[i].SX);
00656       mehSiPixelResY[6]->Fill(FWD2nRecHits[i].RY - FWD2nRecHits[i].SY);
00657     }
00658 
00659     // get DtMuon info
00660     std::vector<PGlobalRecHit::DTRecHit> DTRecHits =
00661       srcGlobalRecHits->getDTRecHits();      
00662     mehDtMuonn->Fill((float)nDTRecHits);
00663     for (unsigned int i = 0; i < DTRecHits.size(); ++i) {
00664       mehDtMuonRes->Fill(DTRecHits[i].RHD - DTRecHits[i].SHD);
00665     }
00666 
00667     // get CSC info
00668     std::vector<PGlobalRecHit::CSCRecHit> CSCRecHits =
00669       srcGlobalRecHits->getCSCRecHits();      
00670     mehCSCn->Fill((float)nCSCRecHits);
00671     for (unsigned int i = 0; i < CSCRecHits.size(); ++i) {
00672       mehCSCResRDPhi->Fill(CSCRecHits[i].RHPERP * 
00673                          (CSCRecHits[i].RHPHI - CSCRecHits[i].SHPHI));
00674     }
00675 
00676     // get RPC info
00677     std::vector<PGlobalRecHit::RPCRecHit> RPCRecHits =
00678       srcGlobalRecHits->getRPCRecHits();      
00679     mehRPCn->Fill((float)nRPCRecHits);
00680     for (unsigned int i = 0; i < RPCRecHits.size(); ++i) {
00681       mehRPCResX->Fill(RPCRecHits[i].RHX - RPCRecHits[i].SHX);
00682     }
00683 
00684   if (verbosity > 0)
00685     edm::LogInfo (MsgLoggerCat)
00686       << "Done gathering data from event.";
00687 
00688 }
00689