CMS 3D CMS Logo

RPCBookDetUnitME.cc

Go to the documentation of this file.
00001 #include <DQM/RPCMonitorDigi/interface/RPCMonitorDigi.h>
00002 #include <DQM/RPCMonitorDigi/interface/RPCBookFolderStructure.h>
00003 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00004 #include <Geometry/RPCGeometry/interface/RPCGeomServ.h>
00005 #include <Geometry/RPCGeometry/interface/RPCGeometry.h>
00006 
00007 using namespace std;
00008 using namespace edm;
00010 map<string, MonitorElement*> RPCMonitorDigi::bookDetUnitME(RPCDetId & detId, const EventSetup & iSetup) {
00011   map<string, MonitorElement*> meMap;  
00012 
00013   string ringType;
00014   int ring;
00015   if(detId.region() == 0) {
00016       ringType = "Wheel";  
00017     ring = detId.ring();
00018   }else if (detId.region() == -1){  
00019     ringType =  "Disk";
00020     ring = detId.region()*detId.station();
00021   }else {
00022     ringType =  "Disk";
00023     ring = detId.station();
00024   }
00025 
00026   RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure();
00027   string folder = "RPC/RecHits/" +  folderStr->folderStructure(detId);
00028 
00029   dbe->setCurrentFolder(folder);
00030   
00031   //get number of strips in current roll
00032   int nstrips = this->stripsInRoll(detId, iSetup);
00033   if (nstrips == 0 ) nstrips = 1;
00034 
00036   RPCGeomServ RPCname(detId);
00037   string nameRoll = RPCname.name();
00038  
00039   stringstream os;
00040   os.str("");
00041   os<<"Occupancy_"<<nameRoll;
00042   meMap[os.str()] = dbe->book1D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5);
00043 
00044   if (dqmexpert) {    
00045     os.str("");
00046     os<<"BXN_"<<nameRoll;
00047     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 21, -10.5, 10.5);
00048 
00049     os.str("");
00050     os<<"ClusterSize_"<<nameRoll;
00051     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 20, 0.5, 20.5);
00052   
00053     os.str("");
00054     os<<"NumberOfClusters_"<<nameRoll;
00055     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
00056 
00057     os.str("");
00058     os<<"NumberOfDigi_"<<nameRoll;
00059     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
00060         
00061     os.str("");
00062     os<<"CrossTalkLow_"<<nameRoll;
00063     meMap[os.str()] = dbe->book1D(os.str(), os.str(),nstrips, 0.5,nstrips+0.5 );
00064     
00065     os.str("");
00066     os<<"CrossTalkHigh_"<<nameRoll;
00067     meMap[os.str()] = dbe->book1D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5);
00068     
00069     os.str("");
00070     os<<"BXWithData_"<<nameRoll;
00071     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
00072 
00074     os.str("");
00075     os<<"RecHitXPosition_"<<nameRoll;
00076     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 80, -120, 120);
00077     
00078     os.str("");
00079     os<<"RecHitDX_"<<nameRoll;
00080     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 30, -10, 10);
00081     
00082     os.str("");
00083     os<<"RecHitCounter_"<<nameRoll;
00084     meMap[os.str()] = dbe->book1D(os.str(), os.str(),20,0.5,20.5);
00085   }
00086   
00087   if (dqmsuperexpert) {    
00088     os.str("");
00089     os<<"BXN_vs_strip_"<<nameRoll;
00090     meMap[os.str()] = dbe->book2D(os.str(), os.str(),  nstrips , 0.5, nstrips+0.5 , 21, -10.5, 10.5);
00091         
00092     os.str("");
00093     os<<"ClusterSize_vs_LowerSrip_"<<nameRoll;
00094     meMap[os.str()] = dbe->book2D(os.str(), os.str(),  nstrips, 0.5,  nstrips+0.5,11, 0.5, 11.5);
00095     
00096     os.str("");
00097     os<<"ClusterSize_vs_HigherStrip_"<<nameRoll;
00098     meMap[os.str()] = dbe->book2D(os.str(), os.str(), nstrips, 0.5,  nstrips+0.5,11, 0.5, 11.5);
00099     
00100     os.str("");
00101     os<<"ClusterSize_vs_Strip_"<<nameRoll;
00102     meMap[os.str()] = dbe->book2D(os.str(), os.str(),nstrips, 0.5, nstrips+0.5,11, 0.5, 11.5);
00103     
00104     os.str("");
00105     os<<"ClusterSize_vs_CentralStrip_"<<nameRoll;
00106     meMap[os.str()] = dbe->book2D(os.str(), os.str(), nstrips, 0.5, nstrips+0.5,11, 0.5, 11.5);
00107  
00109     os.str("");
00110     os<<"MissingHits_"<<nameRoll;
00111     meMap[os.str()] = dbe->book2D(os.str(), os.str(),nstrips , 0, nstrips, 2, 0.,2.);
00112     
00113     os.str("");
00114     os<<"RecHitX_vs_dx_"<<nameRoll;
00115     meMap[os.str()] = dbe->book2D(os.str(), os.str(),30, -100, 100,30,10,10);
00116   }
00117 
00118   MonitorElement * myMe;
00119 
00120   os.str("");
00121   if(detId.region()==0)
00122     os<<"RPC/RecHits/Barrel/Wheel_"<<ring<<"/SummaryBySectors/";
00123   else if (detId.region()==1)
00124     os<<"RPC/RecHits/Endcap+/Disk_"<<ring<<"/SummaryBySectors/";
00125   else 
00126     os<<"RPC/RecHits/Endcap-/Disk_"<<ring<<"/SummaryBySectors/";
00127   string WheelSummary = os.str();
00128   dbe->setCurrentFolder(WheelSummary);
00129   
00130   os.str("");
00131   os<<"Occupancy_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00132   myMe = dbe->get(WheelSummary+"/"+os.str());
00133   
00134   //check if ME for this sector have already been booked
00135   if(myMe)  meMap[os.str()]=myMe;
00136   else {
00137     if(detId.region()==0){
00138       if (detId.sector()==9 || detId.sector()==11)
00139         meMap[os.str()] = dbe->book2D(os.str(), os.str(), 96, 0.5,96.5, 15, 0.5, 15.5);
00140       else  if (detId.sector()==4) 
00141         meMap[os.str()] = dbe->book2D(os.str(), os.str(),  96, 0.5, 96.5, 21, 0.5, 21.5);
00142       else
00143         meMap[os.str()] = dbe->book2D(os.str(), os.str(), 96, 0.5,  96.5, 17, 0.5, 17.5);
00144     }else{//Endcap
00145         meMap[os.str()] = dbe->book2D(os.str(), os.str(), 32, 0.5, 32.5, 54, 0.5, 54.5);
00146     }
00147   }
00148   
00149   os.str("");
00150   os<<"BxDistribution_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00151   myMe = dbe->get(folder+"/"+os.str());
00152   if(myMe)  meMap[os.str()]=myMe;
00153   else meMap[os.str()] = dbe->book1D(os.str(), os.str(), 11, -5.5, 5.5);
00154 
00155   os.str("");
00156   os<<"NumberOfDigi_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00157   myMe = dbe->get(folder+"/"+os.str());
00158   if(myMe)  meMap[os.str()]=myMe;
00159   else meMap[os.str()] = dbe->book1D(os.str(), os.str(), 50, 0.5, 50.5);
00160 
00161   os.str("");
00162   os<<"ClusterSize_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00163   myMe = dbe->get(folder+"/"+os.str());
00164   if(myMe)  meMap[os.str()]=myMe;
00165   else meMap[os.str()] = dbe->book1D(os.str(), os.str(), 20, 0.5, 20.5);
00166 
00167   os.str("");
00168   os<<"NumberOfClusters_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00169   myMe = dbe->get(folder+"/"+os.str());
00170   if(myMe)  meMap[os.str()]=myMe;
00171   else  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 50, 0.5, 50.5);
00172 
00173   os.str("");
00174   os<<"BXWithData_"<<ringType<<"_"<<ring<<"_Sector_"<<detId.sector();
00175   myMe = dbe->get(folder+"/"+os.str());
00176   if(myMe)  meMap[os.str()]=myMe;
00177   else  meMap[os.str()] = dbe->book1D(os.str(), os.str(), 10, 0.5, 10.5);
00178 
00179   return meMap;
00180 }
00181 
00182 map<string, MonitorElement*> RPCMonitorDigi::bookRegionRing(int region, int ring) {  
00183   map<string, MonitorElement*> meMap;  
00184   string ringType = (region ==  0)?"Wheel":"Disk";
00185 
00186   dbe->setCurrentFolder(GlobalHistogramsFolder);
00187   stringstream os;
00188 
00189   os<<"OccupancyXY_"<<ringType<<"_"<<ring;
00190   meMap[os.str()] = dbe->book2D(os.str(), os.str(),63, -800, 800, 63, -800, 800);
00191 
00192   os.str("");
00193   os<<"ClusterSize_"<<ringType<<"_"<<ring;
00194   meMap[os.str()] = dbe->book1D(os.str(), os.str(),20, 0.5, 20.5);
00195 
00196   os.str("");
00197   os<<"1DOccupancy_"<<ringType<<"_";
00198   if (region!=0){
00199     ring = ring*region;
00200     os<<ring;
00201     meMap[os.str()] = dbe->book1D(os.str(), os.str(), 6, 0.5, 6.5);
00202   }else{
00203      os<<ring;
00204      meMap[os.str()] = dbe->book1D(os.str(), os.str(), 12, 0.5, 12.5);
00205   }
00206 
00207   os.str("");
00208   os<<"BxDistribution_"<<ringType<<"_"<<ring;
00209   meMap[os.str()] = dbe->book1D(os.str(), os.str(), 11, -5.5, 5.5);
00210 
00211   return meMap; 
00212 }
00213 
00214 //returns the number of strips in each roll
00215 int  RPCMonitorDigi::stripsInRoll(RPCDetId & id, const EventSetup & iSetup) {
00216   edm::ESHandle<RPCGeometry> rpcgeo;
00217   iSetup.get<MuonGeometryRecord>().get(rpcgeo);
00218 
00219   const RPCRoll * rpcRoll = rpcgeo->roll(id);
00220 
00221   if (rpcRoll)
00222     return  rpcRoll->nstrips();
00223   else 
00224     return 1;
00225 }

Generated on Tue Jun 9 17:33:17 2009 for CMSSW by  doxygen 1.5.4