00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "DQM/RPCMonitorDigi/interface/MuonSegmentEff.h"
00010
00011
00012 #include <memory>
00013
00014
00015
00016 #include "FWCore/Framework/interface/MakerMacros.h"
00017
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019
00020 #include <DataFormats/RPCDigi/interface/RPCDigiCollection.h>
00021
00022 #include <Geometry/RPCGeometry/interface/RPCGeometry.h>
00023 #include <Geometry/RPCGeometry/interface/RPCGeomServ.h>
00024 #include <Geometry/DTGeometry/interface/DTGeometry.h>
00025 #include <Geometry/CSCGeometry/interface/CSCGeometry.h>
00026
00027 #include <DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h>
00028 #include <DataFormats/CSCRecHit/interface/CSCSegmentCollection.h>
00029
00030 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
00031 #include <Geometry/Records/interface/MuonGeometryRecord.h>
00032 #include <Geometry/CommonTopologies/interface/RectangularStripTopology.h>
00033 #include <Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h>
00034
00035 #include <cmath>
00036 #include "TFile.h"
00037 #include "TH1F.h"
00038 #include "TH2F.h"
00039 #include "TCanvas.h"
00040 #include "TAxis.h"
00041 #include "TString.h"
00042
00043
00044 void MuonSegmentEff::beginJob(const edm::EventSetup& iSetup){
00045 std::cout<<"Begin beginJob"<<std::endl;
00046
00047 std::cout <<"\t Getting the RPC Geometry"<<std::endl;
00048 edm::ESHandle<RPCGeometry> rpcGeo;
00049 iSetup.get<MuonGeometryRecord>().get(rpcGeo);
00050
00051 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
00052 if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
00053 RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
00054 std::vector< const RPCRoll*> roles = (ch->rolls());
00055 for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
00056 RPCDetId rpcId = (*r)->id();
00057
00058 if(rpcId.region()==0)allrollstoreBarrel.insert(rpcId);
00059
00060 int region=rpcId.region();
00061
00062 if(region==0&&(incldt||incldtMB4)){
00063 std::cout<<"--Filling the dtstore"<<rpcId<<std::endl;
00064 int wheel=rpcId.ring();
00065 int sector=rpcId.sector();
00066 int station=rpcId.station();
00067 DTStationIndex ind(region,wheel,sector,station);
00068 std::set<RPCDetId> myrolls;
00069 if (rollstoreDT.find(ind)!=rollstoreDT.end()) myrolls=rollstoreDT[ind];
00070 myrolls.insert(rpcId);
00071 rollstoreDT[ind]=myrolls;
00072 }
00073 else if(inclcsc){
00074 std::cout<<"--Filling the cscstore"<<rpcId<<std::endl;
00075 int region=rpcId.region();
00076 int station=rpcId.station();
00077 int ring=rpcId.ring();
00078 int cscring=ring;
00079 int cscstation=station;
00080 RPCGeomServ rpcsrv(rpcId);
00081 int rpcsegment = rpcsrv.segment();
00082 int cscchamber = rpcsegment;
00083 if((station==2||station==3)&&ring==3){
00084 cscring = 2;
00085 }
00086 if((station==4)&&(ring==2||ring==3)){
00087 cscstation=3;
00088 cscring=2;
00089 }
00090 CSCStationIndex ind(region,cscstation,cscring,cscchamber);
00091 std::set<RPCDetId> myrolls;
00092 if (rollstoreCSC.find(ind)!=rollstoreCSC.end()){
00093 myrolls=rollstoreCSC[ind];
00094 }
00095
00096 myrolls.insert(rpcId);
00097 rollstoreCSC[ind]=myrolls;
00098 }
00099 }
00100 }
00101 }
00102 }
00103
00104
00105 MuonSegmentEff::MuonSegmentEff(const edm::ParameterSet& iConfig){
00106 std::cout<<"Begin Constructor"<<std::endl;
00107
00108 std::map<RPCDetId, int> buff;
00109 counter.clear();
00110 counter.reserve(3);
00111 counter.push_back(buff);
00112 counter.push_back(buff);
00113 counter.push_back(buff);
00114 totalcounter.clear();
00115 totalcounter.reserve(3);
00116 totalcounter[0]=0;
00117 totalcounter[1]=0;
00118 totalcounter[2]=0;
00119
00120 incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
00121 incldtMB4=iConfig.getUntrackedParameter<bool>("incldtMB4",true);
00122 inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
00123 prodImages=iConfig.getUntrackedParameter<bool>("prodImages",false);
00124 calcEffi=iConfig.getUntrackedParameter<bool>("calcEffi",true);
00125 mydqm=iConfig.getUntrackedParameter<bool>("mydqm",true);
00126 MinimalResidual= iConfig.getUntrackedParameter<double>("MinimalResidual",2.);
00127 MinimalResidualRB4=iConfig.getUntrackedParameter<double>("MinimalResidualRB4",4.);
00128 MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.9999);
00129 MaxD=iConfig.getUntrackedParameter<double>("MaxD",20.);
00130 MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",30.);
00131 MaxStripToCountInAverage=iConfig.getUntrackedParameter<double>("MaxStripToCountInAverage",5.);
00132 MaxStripToCountInAverageRB4=iConfig.getUntrackedParameter<double>("MaxStripToCountInAverageRB4",7.);
00133 muonRPCDigis=iConfig.getUntrackedParameter<std::string>("muonRPCDigis","muonRPCDigis");
00134 cscSegments=iConfig.getUntrackedParameter<std::string>("cscSegments","cscSegments");
00135 dt4DSegments=iConfig.getUntrackedParameter<std::string>("dt4DSegments","dt4DSegments");
00136 rejected=iConfig.getUntrackedParameter<std::string>("rejected","rejected.txt");
00137 rollseff=iConfig.getUntrackedParameter<std::string>("rollseff","rollseff.txt");
00138 GlobalRootLabel= iConfig.getUntrackedParameter<std::string>("GlobalRootFileName","GlobalEfficiencyFromTrack.root");
00139
00140 std::cout<<rejected<<std::endl;
00141 std::cout<<rollseff<<std::endl;
00142
00143 ofrej.open(rejected.c_str());
00144 ofeff.open(rollseff.c_str());
00145
00146
00147 nameInLog = iConfig.getUntrackedParameter<std::string>("moduleLogName", "RPC_Eff");
00148 EffSaveRootFile = iConfig.getUntrackedParameter<bool>("EffSaveRootFile", true);
00149 EffSaveRootFileEventsInterval = iConfig.getUntrackedParameter<int>("EffEventsInterval", 10000);
00150 EffRootFileName = iConfig.getUntrackedParameter<std::string>("EffRootFileName", "CMSRPCEff.root");
00151
00152 dbe = edm::Service<DQMStore>().operator->();
00153 _idList.clear();
00154
00155
00156 std::cout<<"Booking the Global Histograms"<<std::endl;
00157
00158 fOutputFile = new TFile(GlobalRootLabel.c_str(), "RECREATE" );
00159
00160 if(mydqm){
00161 mydqmHbxdistro = new TH1F("BXDistribution","Bunch Crossing Distribution",11,-5.5,5.5);
00162 mydqmHdigisdistro = new TH1F("DigisDistribution","Number of Digis per event",20,-0.5,20.5);
00163 }
00164
00165 hGlobalRes = new TH1F("GlobalResiduals","All RPC Residuals",250,-10.,10.);
00166 statistics = new TH1F("Statistics","All Statistics",20,0.5,20.5);
00167
00168 hGlobalResLa1 = new TH1F("GlobalResidualsLa1","RPC Residuals Layer 1",250,-10.,10.);
00169 hGlobalResLa2 = new TH1F("GlobalResidualsLa2","RPC Residuals Layer 2",250,-10.,10.);
00170 hGlobalResLa3 = new TH1F("GlobalResidualsLa3","RPC Residuals Layer 3",250,-10.,10.);
00171 hGlobalResLa4 = new TH1F("GlobalResidualsLa4","RPC Residuals Layer 4",250,-10.,10.);
00172 hGlobalResLa5 = new TH1F("GlobalResidualsLa5","RPC Residuals Layer 5",250,-10.,10.);
00173 hGlobalResLa6 = new TH1F("GlobalResidualsLa6","RPC Residuals Layer 6",250,-10.,10.);
00174
00175 hGlobalResClu1La1 = new TH1F("GlobalResidualsClu1La1","RPC Residuals Layer 1 Cluster Size 1",250,-10.,10.);
00176 hGlobalResClu1La2 = new TH1F("GlobalResidualsClu1La2","RPC Residuals Layer 2 Cluster Size 1",250,-10.,10.);
00177 hGlobalResClu1La3 = new TH1F("GlobalResidualsClu1La3","RPC Residuals Layer 3 Cluster Size 1",250,-10.,10.);
00178 hGlobalResClu1La4 = new TH1F("GlobalResidualsClu1La4","RPC Residuals Layer 4 Cluster Size 1",250,-10.,10.);
00179 hGlobalResClu1La5 = new TH1F("GlobalResidualsClu1La5","RPC Residuals Layer 5 Cluster Size 1",250,-10.,10.);
00180 hGlobalResClu1La6 = new TH1F("GlobalResidualsClu1La6","RPC Residuals Layer 6 Cluster Size 1",250,-10.,10.);
00181
00182 hGlobalResClu2La1 = new TH1F("GlobalResidualsClu2La1","RPC Residuals Layer 1 Cluster Size 2",250,-10.,10.);
00183 hGlobalResClu2La2 = new TH1F("GlobalResidualsClu2La2","RPC Residuals Layer 2 Cluster Size 2",250,-10.,10.);
00184 hGlobalResClu2La3 = new TH1F("GlobalResidualsClu2La3","RPC Residuals Layer 3 Cluster Size 2",250,-10.,10.);
00185 hGlobalResClu2La4 = new TH1F("GlobalResidualsClu2La4","RPC Residuals Layer 4 Cluster Size 2",250,-10.,10.);
00186 hGlobalResClu2La5 = new TH1F("GlobalResidualsClu2La5","RPC Residuals Layer 5 Cluster Size 2",250,-10.,10.);
00187 hGlobalResClu2La6 = new TH1F("GlobalResidualsClu2La6","RPC Residuals Layer 6 Cluster Size 2",250,-10.,10.);
00188
00189 hGlobalResClu3La1 = new TH1F("GlobalResidualsClu3La1","RPC Residuals Layer 1 Cluster Size 3",250,-10.,10.);
00190 hGlobalResClu3La2 = new TH1F("GlobalResidualsClu3La2","RPC Residuals Layer 2 Cluster Size 3",250,-10.,10.);
00191 hGlobalResClu3La3 = new TH1F("GlobalResidualsClu3La3","RPC Residuals Layer 3 Cluster Size 3",250,-10.,10.);
00192 hGlobalResClu3La4 = new TH1F("GlobalResidualsClu3La4","RPC Residuals Layer 4 Cluster Size 3",250,-10.,10.);
00193 hGlobalResClu3La5 = new TH1F("GlobalResidualsClu3La5","RPC Residuals Layer 5 Cluster Size 3",250,-10.,10.);
00194 hGlobalResClu3La6 = new TH1F("GlobalResidualsClu3La6","RPC Residuals Layer 6 Cluster Size 3",250,-10.,10.);
00195
00196 hGlobalResY = new TH1F("GlobalResidualsY","Global RPC Residuals Y",500,-100.,100);
00197
00198 hGlobalYResLa1 = new TH1F("GlobalYResidualsLa1","RPC Residuals in Y Layer 1",250,-60.,60.);
00199 hGlobalYResLa2 = new TH1F("GlobalYResidualsLa2","RPC Residuals in Y Layer 2",250,-60.,60.);
00200 hGlobalYResLa3 = new TH1F("GlobalYResidualsLa3","RPC Residuals in Y Layer 3",250,-60.,60.);
00201 hGlobalYResLa4 = new TH1F("GlobalYResidualsLa4","RPC Residuals in Y Layer 4",250,-60.,60.);
00202 hGlobalYResLa5 = new TH1F("GlobalYResidualsLa5","RPC Residuals in Y Layer 5",250,-60.,60.);
00203 hGlobalYResLa6 = new TH1F("GlobalYResidualsLa6","RPC Residuals in Y Layer 6",250,-60.,60.);
00204
00205
00206 OGlobWm2 = new TH1F("GlobOcupancyWheel_-2","Global Ocupancy Wheel -2",205,0.5,205.5);
00207 PGlobWm2 = new TH1F("GlobExpectedWheel_-2","Global Expected Wheel -2",205,0.5,205.5);
00208 EffGlobWm2 = new TH1F("GlobEfficiencyWheel_-2","Global Efficiency Wheel -2",205,0.5,205.5);
00209 EffGlobm2s1 = new TH1F("GlobEfficiencyWheel_m2_Sec1","Eff. vs. roll",20,0.5,20.5);
00210 EffGlobm2s2 = new TH1F("GlobEfficiencyWheel_m2_Sec2","Eff. vs. roll",20,0.5,20.5);
00211 EffGlobm2s3 = new TH1F("GlobEfficiencyWheel_m2_Sec3","Eff. vs. roll",20,0.5,20.5);
00212 EffGlobm2s4 = new TH1F("GlobEfficiencyWheel_m2_Sec4","Eff. vs. roll",20,0.5,20.5);
00213 EffGlobm2s5 = new TH1F("GlobEfficiencyWheel_m2_Sec5","Eff. vs. roll",20,0.5,20.5);
00214 EffGlobm2s6 = new TH1F("GlobEfficiencyWheel_m2_Sec6","Eff. vs. roll",20,0.5,20.5);
00215 EffGlobm2s7 = new TH1F("GlobEfficiencyWheel_m2_Sec7","Eff. vs. roll",20,0.5,20.5);
00216 EffGlobm2s8 = new TH1F("GlobEfficiencyWheel_m2_Sec8","Eff. vs. roll",20,0.5,20.5);
00217 EffGlobm2s9 = new TH1F("GlobEfficiencyWheel_m2_Sec9","Eff. vs. roll",20,0.5,20.5);
00218 EffGlobm2s10 = new TH1F("GlobEfficiencyWheel_m2_Sec10","Eff. vs. roll",20,0.5,20.5);
00219 EffGlobm2s11 = new TH1F("GlobEfficiencyWheel_m2_Sec11","Eff. vs. roll",20,0.5,20.5);
00220 EffGlobm2s12 = new TH1F("GlobEfficiencyWheel_m2_Sec12","Eff. vs. roll",20,0.5,20.5);
00221
00222
00223 OGlobWm1 = new TH1F("GlobOcupancyWheel_-1","Global Ocupancy Wheel -1",205,0.5,205.5);
00224 PGlobWm1 = new TH1F("GlobExpectedWheel_-1","Global Expected Wheel -1",205,0.5,205.5);
00225 EffGlobWm1 = new TH1F("GlobEfficiencyWheel_-1","Global Efficiency Wheel -1",205,0.5,205.5);
00226 EffGlobm1s1 = new TH1F("GlobEfficiencyWheel_m1_Sec1","Eff. vs. roll",20,0.5,20.5);
00227 EffGlobm1s2 = new TH1F("GlobEfficiencyWheel_m1_Sec2","Eff. vs. roll",20,0.5,20.5);
00228 EffGlobm1s3 = new TH1F("GlobEfficiencyWheel_m1_Sec3","Eff. vs. roll",20,0.5,20.5);
00229 EffGlobm1s4 = new TH1F("GlobEfficiencyWheel_m1_Sec4","Eff. vs. roll",20,0.5,20.5);
00230 EffGlobm1s5 = new TH1F("GlobEfficiencyWheel_m1_Sec5","Eff. vs. roll",20,0.5,20.5);
00231 EffGlobm1s6 = new TH1F("GlobEfficiencyWheel_m1_Sec6","Eff. vs. roll",20,0.5,20.5);
00232 EffGlobm1s7 = new TH1F("GlobEfficiencyWheel_m1_Sec7","Eff. vs. roll",20,0.5,20.5);
00233 EffGlobm1s8 = new TH1F("GlobEfficiencyWheel_m1_Sec8","Eff. vs. roll",20,0.5,20.5);
00234 EffGlobm1s9 = new TH1F("GlobEfficiencyWheel_m1_Sec9","Eff. vs. roll",20,0.5,20.5);
00235 EffGlobm1s10 = new TH1F("GlobEfficiencyWheel_m1_Sec10","Eff. vs. roll",20,0.5,20.5);
00236 EffGlobm1s11 = new TH1F("GlobEfficiencyWheel_m1_Sec11","Eff. vs. roll",20,0.5,20.5);
00237 EffGlobm1s12 = new TH1F("GlobEfficiencyWheel_m1_Sec12","Eff. vs. roll",20,0.5,20.5);
00238
00239
00240 OGlobW0 = new TH1F("GlobOcupancyWheel_0","Global Ocupancy Wheel 0",205,0.5,205.5);
00241 PGlobW0 = new TH1F("GlobExpectedWheel_0","Global Expected Wheel 0",205,0.5,205.5);
00242 EffGlobW0 = new TH1F("GlobEfficiencyWheel_0","Global Efficiency Wheel 0",205,0.5,205.5);
00243 EffGlob1 = new TH1F("GlobEfficiencyWheel_0_Sec1","Eff. vs. roll",20,0.5,20.5);
00244 EffGlob2 = new TH1F("GlobEfficiencyWheel_0_Sec2","Eff. vs. roll",20,0.5,20.5);
00245 EffGlob3 = new TH1F("GlobEfficiencyWheel_0_Sec3","Eff. vs. roll",20,0.5,20.5);
00246 EffGlob4 = new TH1F("GlobEfficiencyWheel_0_Sec4","Eff. vs. roll",20,0.5,20.5);
00247 EffGlob5 = new TH1F("GlobEfficiencyWheel_0_Sec5","Eff. vs. roll",20,0.5,20.5);
00248 EffGlob6 = new TH1F("GlobEfficiencyWheel_0_Sec6","Eff. vs. roll",20,0.5,20.5);
00249 EffGlob7 = new TH1F("GlobEfficiencyWheel_0_Sec7","Eff. vs. roll",20,0.5,20.5);
00250 EffGlob8 = new TH1F("GlobEfficiencyWheel_0_Sec8","Eff. vs. roll",20,0.5,20.5);
00251 EffGlob9 = new TH1F("GlobEfficiencyWheel_0_Sec9","Eff. vs. roll",20,0.5,20.5);
00252 EffGlob10 = new TH1F("GlobEfficiencyWheel_0_Sec10","Eff. vs. roll",20,0.5,20.5);
00253 EffGlob11 = new TH1F("GlobEfficiencyWheel_0_Sec11","Eff. vs. roll",20,0.5,20.5);
00254 EffGlob12 = new TH1F("GlobEfficiencyWheel_0_Sec12","Eff. vs. roll",20,0.5,20.5);
00255
00256
00257 OGlobW1 = new TH1F("GlobOcupancyWheel_1","Global Ocupancy Wheel 1",205,0.5,205.5);
00258 PGlobW1 = new TH1F("GlobExpectedWheel_1","Global Expected Wheel 1",205,0.5,205.5);
00259 EffGlobW1 = new TH1F("GlobEfficiencyWheel_1","Global Efficiency Wheel 1",205,0.5,205.5);
00260 EffGlob1s1 = new TH1F("GlobEfficiencyWheel_1_Sec1","Eff. vs. roll",20,0.5,20.5);
00261 EffGlob1s2 = new TH1F("GlobEfficiencyWheel_1_Sec2","Eff. vs. roll",20,0.5,20.5);
00262 EffGlob1s3 = new TH1F("GlobEfficiencyWheel_1_Sec3","Eff. vs. roll",20,0.5,20.5);
00263 EffGlob1s4 = new TH1F("GlobEfficiencyWheel_1_Sec4","Eff. vs. roll",20,0.5,20.5);
00264 EffGlob1s5 = new TH1F("GlobEfficiencyWheel_1_Sec5","Eff. vs. roll",20,0.5,20.5);
00265 EffGlob1s6 = new TH1F("GlobEfficiencyWheel_1_Sec6","Eff. vs. roll",20,0.5,20.5);
00266 EffGlob1s7 = new TH1F("GlobEfficiencyWheel_1_Sec7","Eff. vs. roll",20,0.5,20.5);
00267 EffGlob1s8 = new TH1F("GlobEfficiencyWheel_1_Sec8","Eff. vs. roll",20,0.5,20.5);
00268 EffGlob1s9 = new TH1F("GlobEfficiencyWheel_1_Sec9","Eff. vs. roll",20,0.5,20.5);
00269 EffGlob1s10 = new TH1F("GlobEfficiencyWheel_1_Sec10","Eff. vs. roll",20,0.5,20.5);
00270 EffGlob1s11 = new TH1F("GlobEfficiencyWheel_1_Sec11","Eff. vs. roll",20,0.5,20.5);
00271 EffGlob1s12 = new TH1F("GlobEfficiencyWheel_1_Sec12","Eff. vs. roll",20,0.5,20.5);
00272
00273
00274 OGlobW2 = new TH1F("GlobOcupancyWheel_2","Global Ocupancy Wheel 2",205,0.5,205.5);
00275 PGlobW2 = new TH1F("GlobExpectedWheel_2","Global Expected Wheel 2",205,0.5,205.5);
00276 EffGlobW2 = new TH1F("GlobEfficiencyWheel_2","Global Efficiency Wheel 2",205,0.5,205.5);
00277 EffGlob2s1 = new TH1F("GlobEfficiencyWheel_2_Sec1","Eff. vs. roll",20,0.5,20.5);
00278 EffGlob2s2 = new TH1F("GlobEfficiencyWheel_2_Sec2","Eff. vs. roll",20,0.5,20.5);
00279 EffGlob2s3 = new TH1F("GlobEfficiencyWheel_2_Sec3","Eff. vs. roll",20,0.5,20.5);
00280 EffGlob2s4 = new TH1F("GlobEfficiencyWheel_2_Sec4","Eff. vs. roll",20,0.5,20.5);
00281 EffGlob2s5 = new TH1F("GlobEfficiencyWheel_2_Sec5","Eff. vs. roll",20,0.5,20.5);
00282 EffGlob2s6 = new TH1F("GlobEfficiencyWheel_2_Sec6","Eff. vs. roll",20,0.5,20.5);
00283 EffGlob2s7 = new TH1F("GlobEfficiencyWheel_2_Sec7","Eff. vs. roll",20,0.5,20.5);
00284 EffGlob2s8 = new TH1F("GlobEfficiencyWheel_2_Sec8","Eff. vs. roll",20,0.5,20.5);
00285 EffGlob2s9 = new TH1F("GlobEfficiencyWheel_2_Sec9","Eff. vs. roll",20,0.5,20.5);
00286 EffGlob2s10 = new TH1F("GlobEfficiencyWheel_2_Sec10","Eff. vs. roll",20,0.5,20.5);
00287 EffGlob2s11 = new TH1F("GlobEfficiencyWheel_2_Sec11","Eff. vs. roll",20,0.5,20.5);
00288 EffGlob2s12 = new TH1F("GlobEfficiencyWheel_2_Sec12","Eff. vs. roll",20,0.5,20.5);
00289 }
00290
00291
00292 MuonSegmentEff::~MuonSegmentEff()
00293 {
00294 std::cout<<"Begin Destructor "<<std::endl;
00295
00296 fOutputFile->WriteTObject(hGlobalRes);
00297
00298
00299 statistics->GetXaxis()->SetBinLabel(1,"Events ");
00300 statistics->GetXaxis()->SetBinLabel(2,"Events with DT segments");
00301 statistics->GetXaxis()->SetBinLabel(3,"Events with 1 DT segment");
00302 statistics->GetXaxis()->SetBinLabel(4,"Events with 2 DT segments");
00303 statistics->GetXaxis()->SetBinLabel(5,"Events with 3 DT segments");
00304 statistics->GetXaxis()->SetBinLabel(6,"Events with 4 DT segments");
00305 statistics->GetXaxis()->SetBinLabel(7,"Events with 5 DT segments");
00306 statistics->GetXaxis()->SetBinLabel(8,"Events with 6 DT segments");
00307 statistics->GetXaxis()->SetBinLabel(9,"Events with 7 DT segments");
00308 statistics->GetXaxis()->SetBinLabel(10,"Events with 8 DT segments");
00309 statistics->GetXaxis()->SetBinLabel(11,"Events with 9 DT segments");
00310 statistics->GetXaxis()->SetBinLabel(12,"Events with 10 DT segments");
00311 statistics->GetXaxis()->SetBinLabel(13,"Events with 11 DT segments");
00312 statistics->GetXaxis()->SetBinLabel(14,"Events with 12 DT segments");
00313 statistics->GetXaxis()->SetBinLabel(15,"Events with 13 DT segments");
00314 statistics->GetXaxis()->SetBinLabel(16,"Events with 14 DT segments");
00315 statistics->GetXaxis()->SetBinLabel(17,"Events with 15 DT segments");
00316 statistics->GetXaxis()->SetBinLabel(18,"Events with CSC segments");
00317
00318
00319 statistics->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(statistics);
00320
00321
00322 fOutputFile->WriteTObject(mydqmHdigisdistro);
00323 fOutputFile->WriteTObject(mydqmHbxdistro);
00324
00325 fOutputFile->WriteTObject(hGlobalResLa1);
00326 fOutputFile->WriteTObject(hGlobalResLa2);
00327 fOutputFile->WriteTObject(hGlobalResLa3);
00328 fOutputFile->WriteTObject(hGlobalResLa4);
00329 fOutputFile->WriteTObject(hGlobalResLa5);
00330 fOutputFile->WriteTObject(hGlobalResLa6);
00331
00332 fOutputFile->WriteTObject(hGlobalResY);
00333
00334 fOutputFile->WriteTObject(hGlobalYResLa1);
00335 fOutputFile->WriteTObject(hGlobalYResLa2);
00336 fOutputFile->WriteTObject(hGlobalYResLa3);
00337 fOutputFile->WriteTObject(hGlobalYResLa4);
00338 fOutputFile->WriteTObject(hGlobalYResLa5);
00339 fOutputFile->WriteTObject(hGlobalYResLa6);
00340
00341 fOutputFile->WriteTObject(hGlobalResClu1La1);
00342 fOutputFile->WriteTObject(hGlobalResClu1La2);
00343 fOutputFile->WriteTObject(hGlobalResClu1La3);
00344 fOutputFile->WriteTObject(hGlobalResClu1La4);
00345 fOutputFile->WriteTObject(hGlobalResClu1La5);
00346 fOutputFile->WriteTObject(hGlobalResClu1La6);
00347
00348 fOutputFile->WriteTObject(hGlobalResClu2La1);
00349 fOutputFile->WriteTObject(hGlobalResClu2La2);
00350 fOutputFile->WriteTObject(hGlobalResClu2La3);
00351 fOutputFile->WriteTObject(hGlobalResClu2La4);
00352 fOutputFile->WriteTObject(hGlobalResClu2La5);
00353 fOutputFile->WriteTObject(hGlobalResClu2La6);
00354
00355 fOutputFile->WriteTObject(hGlobalResClu3La1);
00356 fOutputFile->WriteTObject(hGlobalResClu3La2);
00357 fOutputFile->WriteTObject(hGlobalResClu3La3);
00358 fOutputFile->WriteTObject(hGlobalResClu3La4);
00359 fOutputFile->WriteTObject(hGlobalResClu3La5);
00360 fOutputFile->WriteTObject(hGlobalResClu3La6);
00361
00362
00363 std::cout<<"Writing PGlobWm2"<<std::endl;
00364
00365 OGlobWm2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(PGlobWm2);
00366 PGlobWm2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(OGlobWm2);
00367 EffGlobWm2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobWm2);
00368 EffGlobm2s1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s1);
00369 EffGlobm2s2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s2);
00370 EffGlobm2s3->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s3);
00371 EffGlobm2s4->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s4);
00372 EffGlobm2s5->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s5);
00373 EffGlobm2s6->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s6);
00374 EffGlobm2s7->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s7);
00375 EffGlobm2s8->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s8);
00376 EffGlobm2s9->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s9);
00377 EffGlobm2s10->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s10);
00378 EffGlobm2s11->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s11);
00379 EffGlobm2s12->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobm2s12);
00380
00381
00382 std::cout<<"Writing PGlobWm1"<<std::endl;
00383 OGlobWm1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(PGlobWm1);
00384 PGlobWm1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(OGlobWm1);
00385 EffGlobWm1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobWm1);
00386 EffGlobm1s1->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s1);
00387 EffGlobm1s2->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s2);
00388 EffGlobm1s3->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s3);
00389 EffGlobm1s4->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s4);
00390 EffGlobm1s5->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s5);
00391 EffGlobm1s6->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s6);
00392 EffGlobm1s7->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s7);
00393 EffGlobm1s8->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s8);
00394 EffGlobm1s9->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s9);
00395 EffGlobm1s10->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s10);
00396 EffGlobm1s11->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s11);
00397 EffGlobm1s12->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobm1s12);
00398
00399
00400 std::cout<<"Writing PGlobW0"<<std::endl;
00401 OGlobW0->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(PGlobW0);
00402 PGlobW0->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(OGlobW0);
00403 EffGlobW0->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlobW0);
00404 EffGlob1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob1);
00405 EffGlob2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2);
00406 EffGlob3->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob3);
00407 EffGlob4->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob4);
00408 EffGlob5->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob5);
00409 EffGlob6->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob6);
00410 EffGlob7->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob7);
00411 EffGlob8->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob8);
00412 EffGlob9->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob9);
00413 EffGlob10->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob10);
00414 EffGlob11->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob11);
00415 EffGlob12->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob12);
00416
00417
00418 std::cout<<"Writing PGlobW1"<<std::endl;
00419 OGlobW1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(PGlobW1);
00420 PGlobW1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(OGlobW1);
00421 EffGlobW1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobW1);
00422 EffGlob1s1->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s1);
00423 EffGlob1s2->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s2);
00424 EffGlob1s3->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s3);
00425 EffGlob1s4->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s4);
00426 EffGlob1s5->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s5);
00427 EffGlob1s6->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s6);
00428 EffGlob1s7->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s7);
00429 EffGlob1s8->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s8);
00430 EffGlob1s9->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s9);
00431 EffGlob1s10->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s10);
00432 EffGlob1s11->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s11);
00433 EffGlob1s12->GetXaxis()->LabelsOption("v");fOutputFile->WriteTObject(EffGlob1s12);
00434
00435
00436 std::cout<<"Writing PGlobW2"<<std::endl;
00437 OGlobW2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(PGlobW2);
00438 PGlobW2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(OGlobW2);
00439 EffGlobW2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlobW2);
00440 EffGlob2s1->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s1);
00441 EffGlob2s2->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s2);
00442 EffGlob2s3->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s3);
00443 EffGlob2s4->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s4);
00444 EffGlob2s5->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s5);
00445 EffGlob2s6->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s6);
00446 EffGlob2s7->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s7);
00447 EffGlob2s8->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s8);
00448 EffGlob2s9->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s9);
00449 EffGlob2s10->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s10);
00450 EffGlob2s11->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s11);
00451 EffGlob2s12->GetXaxis()->LabelsOption("v"); fOutputFile->WriteTObject(EffGlob2s12);
00452
00453 std::cout<<"Closing File"<<std::endl;
00454 fOutputFile->Close();
00455 }
00456
00457
00458
00459 void MuonSegmentEff::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00460 {
00461 using namespace edm;
00462
00463 std::map<RPCDetId, int> buff;
00464
00465 char layerLabel[128];
00466 char meIdRPC [128];
00467 char meIdDT [128];
00468 char meRPC [128];
00469 char meIdCSC [128];
00470
00471 std::cout<<"New Event "<<iEvent.id().event()<<std::endl;
00472 statistics->Fill(1);
00473
00474 std::cout <<"\t Getting the RPC Geometry"<<std::endl;
00475 edm::ESHandle<RPCGeometry> rpcGeo;
00476 iSetup.get<MuonGeometryRecord>().get(rpcGeo);
00477
00478 std::cout <<"\t Getting the RPC Digis"<<std::endl;
00479 edm::Handle<RPCDigiCollection> rpcDigis;
00480 iEvent.getByLabel(muonRPCDigis, rpcDigis);
00481
00482 if(mydqm){
00483 int digis=0;
00484
00485 RPCDigiCollection::DigiRangeIterator collectionItr;
00486
00487 for(collectionItr=rpcDigis->begin(); collectionItr!=rpcDigis->end(); ++collectionItr){
00488 RPCDigiCollection::const_iterator digiIt;
00489 for (digiIt = ((*collectionItr ).second).first;digiIt!=((*collectionItr).second).second; ++digiIt){
00490 digis++;
00491 int bxs=(*digiIt).bx();
00492 mydqmHbxdistro->Fill(bxs);
00493 }
00494 }
00495 mydqmHdigisdistro->Fill(digis);
00496 }
00497
00498
00499 if(incldt){
00500 #include "dtpart.inl"
00501 }
00502
00503 if(incldtMB4){
00504 #include "rb4part.inl"
00505 }
00506
00507 if(inclcsc){
00508 #include "cscpart.inl"
00509 }
00510 }
00511
00512
00513 void MuonSegmentEff::endJob()
00514 {
00515 std::cout<<"Begin End Job"<<std::endl;
00516
00517 int indexm2[13];
00518 int indexm1[13];
00519 int index0[13];
00520 int index1[13];
00521 int index2[13];
00522 std::cout<<"Starging loop 1"<<std::endl;
00523 for(int j=0;j<13;j++){
00524 indexm2[j]=1;
00525 indexm1[j]=1;
00526 index0[j]=1;
00527 index1[j]=1;
00528 index2[j]=1;
00529 }
00530
00531 std::cout<<"Starging loop 2"<<std::endl;
00532 int indexWheel[5];
00533 for(int j=0;j<5;j++){
00534 indexWheel[j]=1;
00535 }
00536
00537 std::ofstream oftwiki;
00538 oftwiki.open("tabletotwiki.txt");
00539 std::cout<<"Printing twiki header "<<std::endl;
00540 oftwiki <<"| RPC Name | Observed | Predicted | Efficiency % | Error % |";
00541
00542
00543 std::map<RPCDetId, int> pred = counter[0];
00544 std::map<RPCDetId, int> obse = counter[1];
00545 std::map<RPCDetId, int> reje = counter[2];
00546 std::map<RPCDetId, int>::iterator irpc;
00547
00548
00549
00550 for (std::set<RPCDetId>::iterator iteraRoll = allrollstoreBarrel.begin();iteraRoll != allrollstoreBarrel.end(); iteraRoll++){
00551 bool is = false;
00552 for (irpc=pred.begin(); irpc!=pred.end();irpc++){
00553 RPCDetId idtmp=irpc->first;
00554 if(idtmp.rawId()==(*iteraRoll).rawId()){
00555 is=true;
00556 }
00557 }
00558
00559 RPCDetId id = (*iteraRoll);
00560 RPCGeomServ RPCname(id);
00561 std::string nameRoll = RPCname.name();
00562
00563 int p=0;
00564 int o=0;
00565 int r=0;
00566
00567 if(is){
00568 std::cout<<"In Final container"<<RPCname.name()<<std::endl;
00569 p=pred[id];
00570 o=obse[id];
00571 r=reje[id];
00572 assert(p==o+r);
00573 }
00574 else{
00575 std::cout<<"NOT in Final container"<<RPCname.name()<<std::endl;
00576 }
00577
00578 std::string wheel;
00579 std::string rpc;
00580 std::string partition;
00581
00582
00583
00584
00585
00586
00587 if(id.region()==0){
00588 float ef =0;
00589 float er =0;
00590
00591 if(p!=0){
00592 ef = float(o)/float(p);
00593 er = sqrt(ef*(1.-ef)/float(p));
00594 }
00595
00596 ef=ef*100;
00597 er=er*100;
00598
00599 char cam[128];
00600 sprintf(cam,"%s",nameRoll.c_str());
00601 TString camera = (TString)cam;
00602 int Ring=id.ring();
00603 int Sector=id.sector();
00604
00605
00606
00607 if(Ring==-2){
00608 indexWheel[0]++; EffGlobWm2->SetBinContent(indexWheel[0],ef); EffGlobWm2->SetBinError(indexWheel[0],er); EffGlobWm2->GetXaxis()->SetBinLabel(indexWheel[0],camera);
00609 OGlobWm2->SetBinContent(indexWheel[0],o); OGlobWm2->GetXaxis()->SetBinLabel(indexWheel[0],camera);
00610 PGlobWm2->SetBinContent(indexWheel[0],p); PGlobWm2->GetXaxis()->SetBinLabel(indexWheel[0],camera);
00611 if(Sector==1)indexm2[1]++; EffGlobm2s1->SetBinContent(indexm2[1],ef); EffGlobm2s1->SetBinError(indexm2[1],er); EffGlobm2s1->GetXaxis()->SetBinLabel(indexm2[1],camera);
00612 if(Sector==2)indexm2[2]++; EffGlobm2s2->SetBinContent(indexm2[2],ef); EffGlobm2s2->SetBinError(indexm2[2],er); EffGlobm2s2->GetXaxis()->SetBinLabel(indexm2[2],camera);
00613 if(Sector==3)indexm2[3]++; EffGlobm2s3->SetBinContent(indexm2[3],ef); EffGlobm2s3->SetBinError(indexm2[3],er); EffGlobm2s3->GetXaxis()->SetBinLabel(indexm2[3],camera);
00614 if(Sector==4)indexm2[4]++; EffGlobm2s4->SetBinContent(indexm2[4],ef); EffGlobm2s4->SetBinError(indexm2[4],er); EffGlobm2s4->GetXaxis()->SetBinLabel(indexm2[4],camera);
00615 if(Sector==5)indexm2[5]++; EffGlobm2s5->SetBinContent(indexm2[5],ef); EffGlobm2s5->SetBinError(indexm2[5],er); EffGlobm2s5->GetXaxis()->SetBinLabel(indexm2[5],camera);
00616 if(Sector==6)indexm2[6]++; EffGlobm2s6->SetBinContent(indexm2[6],ef); EffGlobm2s6->SetBinError(indexm2[6],er); EffGlobm2s6->GetXaxis()->SetBinLabel(indexm2[6],camera);
00617 if(Sector==7)indexm2[7]++; EffGlobm2s7->SetBinContent(indexm2[7],ef); EffGlobm2s7->SetBinError(indexm2[7],er); EffGlobm2s7->GetXaxis()->SetBinLabel(indexm2[7],camera);
00618 if(Sector==8)indexm2[8]++; EffGlobm2s8->SetBinContent(indexm2[8],ef); EffGlobm2s8->SetBinError(indexm2[8],er); EffGlobm2s8->GetXaxis()->SetBinLabel(indexm2[8],camera);
00619 if(Sector==9)indexm2[9]++; EffGlobm2s9->SetBinContent(indexm2[9],ef); EffGlobm2s9->SetBinError(indexm2[9],er); EffGlobm2s9->GetXaxis()->SetBinLabel(indexm2[9],camera);
00620 if(Sector==10)indexm2[10]++; EffGlobm2s10->SetBinContent(indexm2[10],ef); EffGlobm2s10->SetBinError(indexm2[10],er); EffGlobm2s10->GetXaxis()->SetBinLabel(indexm2[10],camera);
00621 if(Sector==11)indexm2[11]++; EffGlobm2s11->SetBinContent(indexm2[11],ef); EffGlobm2s11->SetBinError(indexm2[11],er); EffGlobm2s11->GetXaxis()->SetBinLabel(indexm2[11],camera);
00622 if(Sector==12)indexm2[12]++; EffGlobm2s12->SetBinContent(indexm2[12],ef); EffGlobm2s12->SetBinError(indexm2[12],er); EffGlobm2s12->GetXaxis()->SetBinLabel(indexm2[12],camera);
00623 }
00624
00625 if(Ring==-1){
00626 indexWheel[1]++; EffGlobWm1->SetBinContent(indexWheel[1],ef); EffGlobWm1->SetBinError(indexWheel[1],er); EffGlobWm1->GetXaxis()->SetBinLabel(indexWheel[1],camera); EffGlobWm1->GetXaxis()->LabelsOption("v");
00627 OGlobWm1->SetBinContent(indexWheel[1],o); OGlobWm1->GetXaxis()->SetBinLabel(indexWheel[1],camera); OGlobWm1->GetXaxis()->LabelsOption("v");
00628 PGlobWm1->SetBinContent(indexWheel[1],p); PGlobWm1->GetXaxis()->SetBinLabel(indexWheel[1],camera); PGlobWm1->GetXaxis()->LabelsOption("v");
00629 if(Sector==1)indexm1[1]++; EffGlobm1s1->SetBinContent(indexm1[1],ef); EffGlobm1s1->SetBinError(indexm1[1],er); EffGlobm1s1->GetXaxis()->SetBinLabel(indexm1[1],camera);
00630 if(Sector==2)indexm1[2]++; EffGlobm1s2->SetBinContent(indexm1[2],ef); EffGlobm1s2->SetBinError(indexm1[2],er); EffGlobm1s2->GetXaxis()->SetBinLabel(indexm1[2],camera);
00631 if(Sector==3)indexm1[3]++; EffGlobm1s3->SetBinContent(indexm1[3],ef); EffGlobm1s3->SetBinError(indexm1[3],er); EffGlobm1s3->GetXaxis()->SetBinLabel(indexm1[3],camera);
00632 if(Sector==4)indexm1[4]++; EffGlobm1s4->SetBinContent(indexm1[4],ef); EffGlobm1s4->SetBinError(indexm1[4],er); EffGlobm1s4->GetXaxis()->SetBinLabel(indexm1[4],camera);
00633 if(Sector==5)indexm1[5]++; EffGlobm1s5->SetBinContent(indexm1[5],ef); EffGlobm1s5->SetBinError(indexm1[5],er); EffGlobm1s5->GetXaxis()->SetBinLabel(indexm1[5],camera);
00634 if(Sector==6)indexm1[6]++; EffGlobm1s6->SetBinContent(indexm1[6],ef); EffGlobm1s6->SetBinError(indexm1[6],er); EffGlobm1s6->GetXaxis()->SetBinLabel(indexm1[6],camera);
00635 if(Sector==7)indexm1[7]++; EffGlobm1s7->SetBinContent(indexm1[7],ef); EffGlobm1s7->SetBinError(indexm1[7],er); EffGlobm1s7->GetXaxis()->SetBinLabel(indexm1[7],camera);
00636 if(Sector==8)indexm1[8]++; EffGlobm1s8->SetBinContent(indexm1[8],ef); EffGlobm1s8->SetBinError(indexm1[8],er); EffGlobm1s8->GetXaxis()->SetBinLabel(indexm1[8],camera);
00637 if(Sector==9)indexm1[9]++; EffGlobm1s9->SetBinContent(indexm1[9],ef); EffGlobm1s9->SetBinError(indexm1[9],er); EffGlobm1s9->GetXaxis()->SetBinLabel(indexm1[9],camera);
00638 if(Sector==10)indexm1[10]++; EffGlobm1s10->SetBinContent(indexm1[10],ef); EffGlobm1s10->SetBinError(indexm1[10],er); EffGlobm1s10->GetXaxis()->SetBinLabel(indexm1[10],camera);
00639 if(Sector==11)indexm1[11]++; EffGlobm1s11->SetBinContent(indexm1[11],ef); EffGlobm1s11->SetBinError(indexm1[11],er); EffGlobm1s11->GetXaxis()->SetBinLabel(indexm1[11],camera);
00640 if(Sector==12)indexm1[12]++; EffGlobm1s12->SetBinContent(indexm1[12],ef); EffGlobm1s12->SetBinError(indexm1[12],er); EffGlobm1s12->GetXaxis()->SetBinLabel(indexm1[12],camera);
00641 }
00642
00643 if(Ring==0){
00644 indexWheel[2]++; EffGlobW0->SetBinContent(indexWheel[2],ef); EffGlobW0->SetBinError(indexWheel[2],er); EffGlobW0->GetXaxis()->SetBinLabel(indexWheel[2],camera); EffGlobW0->GetXaxis()->LabelsOption("v");
00645 OGlobW0->SetBinContent(indexWheel[2],o); OGlobW0->GetXaxis()->SetBinLabel(indexWheel[2],camera); OGlobW0->GetXaxis()->LabelsOption("v");
00646 PGlobW0->SetBinContent(indexWheel[2],p); PGlobW0->GetXaxis()->SetBinLabel(indexWheel[2],camera); PGlobW0->GetXaxis()->LabelsOption("v");
00647 if(Sector==1)index0[1]++; EffGlob1->SetBinContent(index0[1],ef); EffGlob1->SetBinError(index0[1],er); EffGlob1->GetXaxis()->SetBinLabel(index0[1],camera);
00648 if(Sector==2)index0[2]++; EffGlob2->SetBinContent(index0[2],ef); EffGlob2->SetBinError(index0[2],er); EffGlob2->GetXaxis()->SetBinLabel(index0[2],camera);
00649 if(Sector==3)index0[3]++; EffGlob3->SetBinContent(index0[3],ef); EffGlob3->SetBinError(index0[3],er); EffGlob3->GetXaxis()->SetBinLabel(index0[3],camera);
00650 if(Sector==4)index0[4]++; EffGlob4->SetBinContent(index0[4],ef); EffGlob4->SetBinError(index0[4],er); EffGlob4->GetXaxis()->SetBinLabel(index0[4],camera);
00651 if(Sector==5)index0[5]++; EffGlob5->SetBinContent(index0[5],ef); EffGlob5->SetBinError(index0[5],er); EffGlob5->GetXaxis()->SetBinLabel(index0[5],camera);
00652 if(Sector==6)index0[6]++; EffGlob6->SetBinContent(index0[6],ef); EffGlob6->SetBinError(index0[6],er); EffGlob6->GetXaxis()->SetBinLabel(index0[6],camera);
00653 if(Sector==7)index0[7]++; EffGlob7->SetBinContent(index0[7],ef); EffGlob7->SetBinError(index0[7],er); EffGlob7->GetXaxis()->SetBinLabel(index0[7],camera);
00654 if(Sector==8)index0[8]++; EffGlob8->SetBinContent(index0[8],ef); EffGlob8->SetBinError(index0[8],er); EffGlob8->GetXaxis()->SetBinLabel(index0[8],camera);
00655 if(Sector==9)index0[9]++; EffGlob9->SetBinContent(index0[9],ef); EffGlob9->SetBinError(index0[9],er); EffGlob9->GetXaxis()->SetBinLabel(index0[9],camera);
00656 if(Sector==10)index0[10]++; EffGlob10->SetBinContent(index0[10],ef); EffGlob10->SetBinError(index0[10],er); EffGlob10->GetXaxis()->SetBinLabel(index0[10],camera);
00657 if(Sector==11)index0[11]++; EffGlob11->SetBinContent(index0[11],ef); EffGlob11->SetBinError(index0[11],er); EffGlob11->GetXaxis()->SetBinLabel(index0[11],camera);
00658 if(Sector==12)index0[12]++; EffGlob12->SetBinContent(index0[12],ef); EffGlob12->SetBinError(index0[12],er); EffGlob12->GetXaxis()->SetBinLabel(index0[12],camera);
00659 }
00660
00661 if(Ring==1){
00662 indexWheel[3]++; EffGlobW1->SetBinContent(indexWheel[3],ef); EffGlobW1->SetBinError(indexWheel[3],er); EffGlobW1->GetXaxis()->SetBinLabel(indexWheel[3],camera); EffGlobW1->GetXaxis()->LabelsOption("v");
00663 OGlobW1->SetBinContent(indexWheel[3],o); OGlobW1->GetXaxis()->SetBinLabel(indexWheel[3],camera); OGlobW1->GetXaxis()->LabelsOption("v");
00664 PGlobW1->SetBinContent(indexWheel[3],p); PGlobW1->GetXaxis()->SetBinLabel(indexWheel[3],camera); PGlobW1->GetXaxis()->LabelsOption("v");
00665 if(Sector==1)index1[1]++; EffGlob1s1->SetBinContent(index1[1],ef); EffGlob1s1->SetBinError(index1[1],er); EffGlob1s1->GetXaxis()->SetBinLabel(index1[1],camera);
00666 if(Sector==2)index1[2]++; EffGlob1s2->SetBinContent(index1[2],ef); EffGlob1s2->SetBinError(index1[2],er); EffGlob1s2->GetXaxis()->SetBinLabel(index1[2],camera);
00667 if(Sector==3)index1[3]++; EffGlob1s3->SetBinContent(index1[3],ef); EffGlob1s3->SetBinError(index1[3],er); EffGlob1s3->GetXaxis()->SetBinLabel(index1[3],camera);
00668 if(Sector==4)index1[4]++; EffGlob1s4->SetBinContent(index1[4],ef); EffGlob1s4->SetBinError(index1[4],er); EffGlob1s4->GetXaxis()->SetBinLabel(index1[4],camera);
00669 if(Sector==5)index1[5]++; EffGlob1s5->SetBinContent(index1[5],ef); EffGlob1s5->SetBinError(index1[5],er); EffGlob1s5->GetXaxis()->SetBinLabel(index1[5],camera);
00670 if(Sector==6)index1[6]++; EffGlob1s6->SetBinContent(index1[6],ef); EffGlob1s6->SetBinError(index1[6],er); EffGlob1s6->GetXaxis()->SetBinLabel(index1[6],camera);
00671 if(Sector==7)index1[7]++; EffGlob1s7->SetBinContent(index1[7],ef); EffGlob1s7->SetBinError(index1[7],er); EffGlob1s7->GetXaxis()->SetBinLabel(index1[7],camera);
00672 if(Sector==8)index1[8]++; EffGlob1s8->SetBinContent(index1[8],ef); EffGlob1s8->SetBinError(index1[8],er); EffGlob1s8->GetXaxis()->SetBinLabel(index1[8],camera);
00673 if(Sector==9)index1[9]++; EffGlob1s9->SetBinContent(index1[9],ef); EffGlob1s9->SetBinError(index1[9],er); EffGlob1s9->GetXaxis()->SetBinLabel(index1[9],camera);
00674 if(Sector==10)index1[10]++; EffGlob1s10->SetBinContent(index1[10],ef); EffGlob1s10->SetBinError(index1[10],er); EffGlob1s10->GetXaxis()->SetBinLabel(index1[10],camera);
00675 if(Sector==11)index1[11]++; EffGlob1s11->SetBinContent(index1[11],ef); EffGlob1s11->SetBinError(index1[11],er); EffGlob1s11->GetXaxis()->SetBinLabel(index1[11],camera);
00676 if(Sector==12)index1[12]++; EffGlob1s12->SetBinContent(index1[12],ef); EffGlob1s12->SetBinError(index1[12],er); EffGlob1s12->GetXaxis()->SetBinLabel(index1[12],camera);
00677 }
00678
00679
00680 if(Ring==2){
00681 indexWheel[4]++; EffGlobW2->SetBinContent(indexWheel[4],ef); EffGlobW2->SetBinError(indexWheel[4],er); EffGlobW2->GetXaxis()->SetBinLabel(indexWheel[4],camera); EffGlobW2->GetXaxis()->LabelsOption("v");
00682 OGlobW2->SetBinContent(indexWheel[4],o); OGlobW2->GetXaxis()->SetBinLabel(indexWheel[4],camera); OGlobW2->GetXaxis()->LabelsOption("v");
00683 PGlobW2->SetBinContent(indexWheel[4],p); PGlobW2->GetXaxis()->SetBinLabel(indexWheel[4],camera); PGlobW2->GetXaxis()->LabelsOption("v");
00684 if(Sector==1)index2[1]++; EffGlob2s1->SetBinContent(index2[1],ef); EffGlob2s1->SetBinError(index2[1],er); EffGlob2s1->GetXaxis()->SetBinLabel(index2[1],camera);
00685 if(Sector==2)index2[2]++; EffGlob2s2->SetBinContent(index2[2],ef); EffGlob2s2->SetBinError(index2[2],er); EffGlob2s2->GetXaxis()->SetBinLabel(index2[2],camera);
00686 if(Sector==3)index2[3]++; EffGlob2s3->SetBinContent(index2[3],ef); EffGlob2s3->SetBinError(index2[3],er); EffGlob2s3->GetXaxis()->SetBinLabel(index2[3],camera);
00687 if(Sector==4)index2[4]++; EffGlob2s4->SetBinContent(index2[4],ef); EffGlob2s4->SetBinError(index2[4],er); EffGlob2s4->GetXaxis()->SetBinLabel(index2[4],camera);
00688 if(Sector==5)index2[5]++; EffGlob2s5->SetBinContent(index2[5],ef); EffGlob2s5->SetBinError(index2[5],er); EffGlob2s5->GetXaxis()->SetBinLabel(index2[5],camera);
00689 if(Sector==6)index2[6]++; EffGlob2s6->SetBinContent(index2[6],ef); EffGlob2s6->SetBinError(index2[6],er); EffGlob2s6->GetXaxis()->SetBinLabel(index2[6],camera);
00690 if(Sector==7)index2[7]++; EffGlob2s7->SetBinContent(index2[7],ef); EffGlob2s7->SetBinError(index2[7],er); EffGlob2s7->GetXaxis()->SetBinLabel(index2[7],camera);
00691 if(Sector==8)index2[8]++; EffGlob2s8->SetBinContent(index2[8],ef); EffGlob2s8->SetBinError(index2[8],er); EffGlob2s8->GetXaxis()->SetBinLabel(index2[8],camera);
00692 if(Sector==9)index2[9]++; EffGlob2s9->SetBinContent(index2[9],ef); EffGlob2s9->SetBinError(index2[9],er); EffGlob2s9->GetXaxis()->SetBinLabel(index2[9],camera);
00693 if(Sector==10)index2[10]++; EffGlob2s10->SetBinContent(index2[10],ef); EffGlob2s10->SetBinError(index2[10],er); EffGlob2s10->GetXaxis()->SetBinLabel(index2[10],camera);
00694 if(Sector==11)index2[11]++; EffGlob2s11->SetBinContent(index2[11],ef); EffGlob2s11->SetBinError(index2[11],er); EffGlob2s11->GetXaxis()->SetBinLabel(index2[11],camera);
00695 if(Sector==12)index2[12]++; EffGlob2s12->SetBinContent(index2[12],ef); EffGlob2s12->SetBinError(index2[12],er); EffGlob2s12->GetXaxis()->SetBinLabel(index2[12],camera);
00696 }
00697 }
00698
00699
00700
00701
00702 if(p!=0){
00703 float ef = float(o)/float(p);
00704 float er = sqrt(ef*(1.-ef)/float(p));
00705 std::cout <<"\n "<<id<<"\t Predicted "<<p<<"\t Observed "<<o<<"\t Eff = "<<ef*100.<<" % +/- "<<er*100.<<" %";
00706 ofeff <<"\n "<<id<<"\t Predicted "<<p<<"\t Observed "<<o<<"\t Eff = "<<ef*100.<<" % +/- "<<er*100.<<" %";
00707 RPCGeomServ RPCname(id);
00708 oftwiki <<"\n | "<<RPCname.name()<<" | "<<o<<" | "<<p<<" | "<<ef*100.<<" | "<<er*100<<" |";
00709
00710
00711
00712
00713 }
00714 else{
00715 std::cout<<"No predictions in this file p=0"<<std::endl;
00716 ofeff<<"No predictions in this file p=0"<<std::endl;
00717 }
00718 }
00719
00720
00721
00722
00723 if(totalcounter[0]!=0){
00724 float tote = float(totalcounter[1])/float(totalcounter[0]);
00725 float totr = sqrt(tote*(1.-tote)/float(totalcounter[0]));
00726
00727 std::cout <<"\n\n \t \t TOTAL EFFICIENCY \t Predicted "<<totalcounter[0]<<"\t Observed "<<totalcounter[1]<<"\t Eff = "<<tote*100.<<"\t +/- \t"<<totr*100.<<" %"<<std::endl;
00728 std::cout <<totalcounter[1]<<" "<<totalcounter[0]<<" flagcode"<<std::endl;
00729
00730 ofeff <<"\n\n \t \t TOTAL EFFICIENCY \t Predicted "<<totalcounter[0]<<"\t Observed "<<totalcounter[1]<<"\t Eff = "<<tote*100.<<"\t +/- \t"<<totr*100.<<" %"<<std::endl;
00731 ofeff <<totalcounter[1]<<" "<<totalcounter[0]<<" flagcode"<<std::endl;
00732
00733 }
00734 else{
00735 std::cout<<"No predictions in this file = 0!!!"<<std::endl;
00736 ofeff <<"No predictions in this file = 0!!!"<<std::endl;
00737 }
00738
00739 std::vector<std::string>::iterator meIt;
00740 int k = 0;
00741
00742 if(EffSaveRootFile==true){
00743 for(meIt = _idList.begin(); meIt != _idList.end(); ++meIt){
00744 k++;
00745 const char * rpcname = (*meIt).c_str();
00746
00748 std::cout<<rpcname[0]<<std::endl;
00749 char detUnitLabel[128];
00750
00751 if(rpcname[0]==87){
00752 char meIdRPC [128];
00753 char meIdDT [128];
00754 char effIdRPC_DT [128];
00755 char meIdRPC_2D [128];
00756 char meIdDT_2D [128];
00757 char effIdRPC_DT_2D [128];
00758
00759
00760 sprintf(detUnitLabel ,"%s",(*meIt).c_str());
00761 std::cout<<"Creating Efficiency Root File #"<<k<<" for "<<detUnitLabel<<std::endl;
00762 sprintf(meIdRPC,"RPCDataOccupancyFromDT_%s",detUnitLabel);
00763 sprintf(meIdRPC_2D,"RPCDataOccupancy2DFromDT_%s",detUnitLabel);
00764 sprintf(meIdDT,"ExpectedOccupancyFromDT_%s",detUnitLabel);
00765 sprintf(meIdDT_2D,"ExpectedOccupancy2DFromDT_%s",detUnitLabel);
00766 sprintf(effIdRPC_DT,"EfficienyFromDTExtrapolation_%s",detUnitLabel);
00767 sprintf(effIdRPC_DT_2D,"EfficienyFromDT2DExtrapolation_%s",detUnitLabel);
00768
00769 std::cout<<"done sprints now declaring map"<<std::endl;
00770
00771 std::map<std::string, MonitorElement*> meMap=meCollection[*meIt];
00772
00773 for(unsigned int i=1;i<=100;++i){
00774 if(meMap[meIdDT]->getBinContent(i) != 0){
00775 float eff = meMap[meIdRPC]->getBinContent(i)/meMap[meIdDT]->getBinContent(i);
00776 float erreff = sqrt(eff*(1-eff)/meMap[meIdDT]->getBinContent(i));
00777 meMap[effIdRPC_DT]->setBinContent(i,eff*100.);
00778 meMap[effIdRPC_DT]->setBinError(i,erreff*100.);
00779 }
00780 }
00781 for(unsigned int i=1;i<=100;++i){
00782 for(unsigned int j=1;j<=200;++j){
00783 if(meMap[meIdDT_2D]->getBinContent(i,j) != 0){
00784 float eff = meMap[meIdRPC_2D]->getBinContent(i,j)/meMap[meIdDT_2D]->getBinContent(i,j);
00785 float erreff = sqrt(eff*(1-eff)/meMap[meIdDT_2D]->getBinContent(i,j));
00786 meMap[effIdRPC_DT_2D]->setBinContent(i,j,eff*100.);
00787 meMap[effIdRPC_DT_2D]->setBinError(i,j,erreff*100.);
00788 }
00789 }
00790 }
00791 }else{
00792 char meRPC [128];
00793 char meIdCSC [128];
00794 char effIdRPC_CSC [128];
00795
00796 char meRPC_2D [128];
00797 char meIdCSC_2D [128];
00798 char effIdRPC_CSC_2D [128];
00799
00800 sprintf(detUnitLabel ,"%s",(*meIt).c_str());
00801
00802 sprintf(meRPC,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
00803 sprintf(meRPC_2D,"RPCDataOccupancy2DFromCSC_%s",detUnitLabel);
00804
00805 sprintf(meIdCSC,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
00806 sprintf(meIdCSC_2D,"ExpectedOccupancy2DFromCSC_%s",detUnitLabel);
00807
00808 sprintf(effIdRPC_CSC,"EfficienyFromCSCExtrapolation_%s",detUnitLabel);
00809 sprintf(effIdRPC_CSC_2D,"EfficienyFromCSC2DExtrapolation_%s",detUnitLabel);
00810
00811 std::map<std::string, MonitorElement*> meMap=meCollection[*meIt];
00812
00813 for(unsigned int i=1;i<=100;++i){
00814
00815 if(meMap[meIdCSC]->getBinContent(i) != 0){
00816 float eff = meMap[meRPC]->getBinContent(i)/meMap[meIdCSC]->getBinContent(i);
00817 float erreff = sqrt(eff*(1-eff)/meMap[meIdCSC]->getBinContent(i));
00818 meMap[effIdRPC_CSC]->setBinContent(i,eff*100.);
00819 meMap[effIdRPC_CSC]->setBinError(i,erreff*100.);
00820 }
00821 }
00822 for(unsigned int i=1;i<=100;++i){
00823 for(unsigned int j=1;j<=200;++j){
00824 if(meMap[meIdCSC_2D]->getBinContent(i,j) != 0){
00825 float eff = meMap[meRPC_2D]->getBinContent(i,j)/meMap[meIdCSC_2D]->getBinContent(i,j);
00826 float erreff = sqrt(eff*(1-eff)/meMap[meIdCSC_2D]->getBinContent(i,j));
00827 meMap[effIdRPC_CSC_2D]->setBinContent(i,j,eff*100.);
00828 meMap[effIdRPC_CSC_2D]->setBinError(i,j,erreff*100.);
00829 }
00830 }
00831 }
00832 }
00833 }
00834 std::cout<<"Saving RootFile"<<std::endl;
00835 dbe->save(EffRootFileName);
00836 }
00837
00838 if(prodImages){
00839 Ca2 = new TCanvas("Ca2","Residuals",800,600);
00840
00841 std::cout<<"My DQM Images"<<std::endl;
00842
00843 mydqmHbxdistro->Draw();
00844 mydqmHbxdistro->GetXaxis()->SetTitle("bx");
00845 Ca2->SaveAs("BXDistribution.png");
00846 Ca2->Clear();
00847
00848 mydqmHdigisdistro->Draw();
00849 mydqmHdigisdistro->GetXaxis()->SetTitle("Number of digis per event");
00850 Ca2->SaveAs("DigisPerEvent.png");
00851 Ca2->Clear();
00852
00853 std::cout<<"Creating Residuals for Different Layers"<<std::endl;
00854 hGlobalResLa1->Draw();
00855 hGlobalResLa1->GetXaxis()->SetTitle("Residuals (cm)");
00856 Ca2->SaveAs("ResidualsLayer1.png");
00857 Ca2->Clear();
00858
00859 hGlobalResLa2->Draw();
00860 hGlobalResLa2->GetXaxis()->SetTitle("Residuals (cm)");
00861 Ca2->SaveAs("ResidualsLayer2.png");
00862 Ca2->Clear();
00863
00864 hGlobalResLa3->Draw();
00865 hGlobalResLa3->GetXaxis()->SetTitle("Residuals (cm)");
00866 Ca2->SaveAs("ResidualsLayer3.png");
00867 Ca2->Clear();
00868
00869 hGlobalResLa4->Draw();
00870 hGlobalResLa4->GetXaxis()->SetTitle("Residuals (cm)");
00871 Ca2->SaveAs("ResidualsLayer4.png");
00872 Ca2->Clear();
00873
00874 hGlobalResLa5->Draw();
00875 hGlobalResLa5->GetXaxis()->SetTitle("Residuals (cm)");
00876 Ca2->SaveAs("ResidualsLayer5.png");
00877 Ca2->Clear();
00878
00879 hGlobalResLa6->Draw();
00880 hGlobalResLa6->GetXaxis()->SetTitle("Residuals (cm)");
00881 Ca2->SaveAs("ResidualsLayer6.png");
00882 Ca2->Clear();
00883
00884 hGlobalResClu1La1->Draw(); hGlobalResClu1La1->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La1.png"); Ca2->Clear();
00885 hGlobalResClu1La2->Draw(); hGlobalResClu1La2->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La2.png"); Ca2->Clear();
00886 hGlobalResClu1La3->Draw(); hGlobalResClu1La3->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La3.png"); Ca2->Clear();
00887 hGlobalResClu1La4->Draw(); hGlobalResClu1La4->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La4.png"); Ca2->Clear();
00888 hGlobalResClu1La5->Draw(); hGlobalResClu1La5->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La5.png"); Ca2->Clear();
00889 hGlobalResClu1La6->Draw(); hGlobalResClu1La6->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu1La6.png"); Ca2->Clear();
00890
00891 hGlobalResClu2La1->Draw(); hGlobalResClu2La1->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La1.png"); Ca2->Clear();
00892 hGlobalResClu2La2->Draw(); hGlobalResClu2La2->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La2.png"); Ca2->Clear();
00893 hGlobalResClu2La3->Draw(); hGlobalResClu2La3->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La3.png"); Ca2->Clear();
00894 hGlobalResClu2La4->Draw(); hGlobalResClu2La4->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La4.png"); Ca2->Clear();
00895 hGlobalResClu2La5->Draw(); hGlobalResClu2La5->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La5.png"); Ca2->Clear();
00896 hGlobalResClu2La6->Draw(); hGlobalResClu2La6->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu2La6.png"); Ca2->Clear();
00897
00898 hGlobalResClu3La1->Draw(); hGlobalResClu3La1->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La1.png"); Ca2->Clear();
00899 hGlobalResClu3La2->Draw(); hGlobalResClu3La2->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La2.png"); Ca2->Clear();
00900 hGlobalResClu3La3->Draw(); hGlobalResClu3La3->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La3.png"); Ca2->Clear();
00901 hGlobalResClu3La4->Draw(); hGlobalResClu3La4->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La4.png"); Ca2->Clear();
00902 hGlobalResClu3La5->Draw(); hGlobalResClu3La5->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La5.png"); Ca2->Clear();
00903 hGlobalResClu3La6->Draw(); hGlobalResClu3La6->GetXaxis()->SetTitle("Residuals (cm)"); Ca2->SaveAs("ResidualsClu3La6.png"); Ca2->Clear();
00904
00905 std::ofstream layertableClu1;
00906 layertableClu1.open("layertableClu1.txt");
00907 layertableClu1<<"| Layer | RMS for Cluster Size =1 | Strip Width / sqrt(12) |"<<std::endl;
00908 layertableClu1<<"| 1 | "<<hGlobalResClu1La1->GetRMS()<<" | | "<<std::endl;
00909 layertableClu1<<"| 2 | "<<hGlobalResClu1La2->GetRMS()<<" | | "<<std::endl;
00910 layertableClu1<<"| 3 | "<<hGlobalResClu1La3->GetRMS()<<" | | "<<std::endl;
00911 layertableClu1<<"| 4 | "<<hGlobalResClu1La4->GetRMS()<<" | | "<<std::endl;
00912 layertableClu1<<"| 5 | "<<hGlobalResClu1La5->GetRMS()<<" | | "<<std::endl;
00913 layertableClu1<<"| 6 | "<<hGlobalResClu1La6->GetRMS()<<" | | "<<std::endl;
00914
00915 layertableClu1.close();
00916
00917 std::ofstream layertableClu3;
00918 layertableClu3.open("layertableClu3.txt");
00919 layertableClu3<<"| Layer | RMS for Cluster Size =1 | Strip Width / sqrt(12) |"<<std::endl;
00920 layertableClu3<<"| 1 | "<<hGlobalResClu3La1->GetRMS()<<" | | "<<std::endl;
00921 layertableClu3<<"| 2 | "<<hGlobalResClu3La2->GetRMS()<<" | | "<<std::endl;
00922 layertableClu3<<"| 3 | "<<hGlobalResClu3La3->GetRMS()<<" | | "<<std::endl;
00923 layertableClu3<<"| 4 | "<<hGlobalResClu3La4->GetRMS()<<" | | "<<std::endl;
00924 layertableClu3<<"| 5 | "<<hGlobalResClu3La5->GetRMS()<<" | | "<<std::endl;
00925 layertableClu3<<"| 6 | "<<hGlobalResClu3La6->GetRMS()<<" | | "<<std::endl;
00926
00927 layertableClu3.close();
00928 }
00929
00930
00931
00932
00933 ofeff.close();
00934 oftwiki.close();
00935 ofrej.close();
00936 }