CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Validation/RecoTrack/src/MTVHistoProducerAlgoForTracker.cc

Go to the documentation of this file.
00001 #include "Validation/RecoTrack/interface/MTVHistoProducerAlgoForTracker.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "DataFormats/TrackReco/interface/Track.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 
00006 #include "DataFormats/TrackReco/interface/DeDxData.h"
00007 #include "DataFormats/Common/interface/ValueMap.h"
00008 #include "DataFormats/Common/interface/Ref.h"
00009 #include <DataFormats/TrackReco/interface/TrackFwd.h>
00010 
00011 #include "DQMServices/ClientConfig/interface/FitSlicesYTool.h"
00012 
00013 #include "TMath.h"
00014 #include <TF1.h>
00015 
00016 using namespace std;
00017 
00018 MTVHistoProducerAlgoForTracker::MTVHistoProducerAlgoForTracker(const edm::ParameterSet& pset): MTVHistoProducerAlgo(pset){
00019   //parameters for _vs_eta plots
00020   minEta  = pset.getParameter<double>("minEta");  
00021   maxEta  = pset.getParameter<double>("maxEta");
00022   nintEta = pset.getParameter<int>("nintEta");
00023   useFabsEta = pset.getParameter<bool>("useFabsEta");
00024 
00025   //parameters for _vs_pt plots
00026   minPt  = pset.getParameter<double>("minPt");
00027   maxPt  = pset.getParameter<double>("maxPt");
00028   nintPt = pset.getParameter<int>("nintPt");
00029   useInvPt = pset.getParameter<bool>("useInvPt");
00030   useLogPt = pset.getUntrackedParameter<bool>("useLogPt",false);
00031 
00032   //parameters for _vs_Hit plots
00033   minHit  = pset.getParameter<double>("minHit");
00034   maxHit  = pset.getParameter<double>("maxHit");
00035   nintHit = pset.getParameter<int>("nintHit");
00036   
00037   //parameters for _vs_phi plots
00038   minPhi  = pset.getParameter<double>("minPhi");
00039   maxPhi  = pset.getParameter<double>("maxPhi");
00040   nintPhi = pset.getParameter<int>("nintPhi");
00041 
00042   //parameters for _vs_Dxy plots
00043   minDxy  = pset.getParameter<double>("minDxy");
00044   maxDxy  = pset.getParameter<double>("maxDxy");
00045   nintDxy = pset.getParameter<int>("nintDxy");
00046     
00047   //parameters for _vs_Dz plots
00048   minDz  = pset.getParameter<double>("minDz");
00049   maxDz  = pset.getParameter<double>("maxDz");
00050   nintDz = pset.getParameter<int>("nintDz");
00051 
00052   //parameters for _vs_ProductionVertexTransvPosition plots
00053   minVertpos  = pset.getParameter<double>("minVertpos");
00054   maxVertpos  = pset.getParameter<double>("maxVertpos");
00055   nintVertpos = pset.getParameter<int>("nintVertpos");
00056 
00057   //parameters for _vs_ProductionVertexZPosition plots
00058   minZpos  = pset.getParameter<double>("minZpos");
00059   maxZpos  = pset.getParameter<double>("maxZpos");
00060   nintZpos = pset.getParameter<int>("nintZpos");
00061 
00062   //parameters for dE/dx plots
00063   minDeDx  = pset.getParameter<double>("minDeDx");
00064   maxDeDx  = pset.getParameter<double>("maxDeDx");
00065   nintDeDx = pset.getParameter<int>("nintDeDx");
00066   
00067   //parameters for Pileup plots
00068   minVertcount  = pset.getParameter<double>("minVertcount");
00069   maxVertcount  = pset.getParameter<double>("maxVertcount");
00070   nintVertcount = pset.getParameter<int>("nintVertcount");
00071 
00072   //parameters for resolution plots
00073   ptRes_rangeMin = pset.getParameter<double>("ptRes_rangeMin");
00074   ptRes_rangeMax = pset.getParameter<double>("ptRes_rangeMax");
00075   ptRes_nbin = pset.getParameter<int>("ptRes_nbin");
00076 
00077   phiRes_rangeMin = pset.getParameter<double>("phiRes_rangeMin");
00078   phiRes_rangeMax = pset.getParameter<double>("phiRes_rangeMax");
00079   phiRes_nbin = pset.getParameter<int>("phiRes_nbin");
00080 
00081   cotThetaRes_rangeMin = pset.getParameter<double>("cotThetaRes_rangeMin");
00082   cotThetaRes_rangeMax = pset.getParameter<double>("cotThetaRes_rangeMax");
00083   cotThetaRes_nbin = pset.getParameter<int>("cotThetaRes_nbin");
00084 
00085   dxyRes_rangeMin = pset.getParameter<double>("dxyRes_rangeMin");
00086   dxyRes_rangeMax = pset.getParameter<double>("dxyRes_rangeMax");
00087   dxyRes_nbin = pset.getParameter<int>("dxyRes_nbin");
00088 
00089   dzRes_rangeMin = pset.getParameter<double>("dzRes_rangeMin");
00090   dzRes_rangeMax = pset.getParameter<double>("dzRes_rangeMax");
00091   dzRes_nbin = pset.getParameter<int>("dzRes_nbin");
00092 
00093 
00094   //--- tracking particle selectors for efficiency measurements
00095   using namespace edm;
00096 
00097   ParameterSet generalTpSelectorPSet = pset.getParameter<ParameterSet>("generalTpSelector");
00098   ParameterSet TpSelectorForEfficiencyVsEtaPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsEta");
00099   ParameterSet TpSelectorForEfficiencyVsPhiPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsPhi");
00100   ParameterSet TpSelectorForEfficiencyVsPtPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsPt");
00101   ParameterSet TpSelectorForEfficiencyVsVTXRPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsVTXR");
00102   ParameterSet TpSelectorForEfficiencyVsVTXZPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsVTXZ");
00103 
00104   ParameterSet generalGpSelectorPSet = pset.getParameter<ParameterSet>("generalGpSelector");
00105   ParameterSet GpSelectorForEfficiencyVsEtaPSet = pset.getParameter<ParameterSet>("GpSelectorForEfficiencyVsEta");
00106   ParameterSet GpSelectorForEfficiencyVsPhiPSet = pset.getParameter<ParameterSet>("GpSelectorForEfficiencyVsPhi");
00107   ParameterSet GpSelectorForEfficiencyVsPtPSet  = pset.getParameter<ParameterSet>("GpSelectorForEfficiencyVsPt");
00108   ParameterSet GpSelectorForEfficiencyVsVTXRPSet = pset.getParameter<ParameterSet>("GpSelectorForEfficiencyVsVTXR");
00109   ParameterSet GpSelectorForEfficiencyVsVTXZPSet = pset.getParameter<ParameterSet>("GpSelectorForEfficiencyVsVTXZ");
00110 
00111   ParameterSet TpSelectorForEfficiencyVsConPSet = TpSelectorForEfficiencyVsEtaPSet;
00112   Entry name("signalOnly",false,true);
00113   TpSelectorForEfficiencyVsConPSet.insert(true,"signalOnly",name);
00114   
00115   using namespace reco::modules;
00116   generalTpSelector               = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(generalTpSelectorPSet));
00117   TpSelectorForEfficiencyVsEta    = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsEtaPSet));
00118   TpSelectorForEfficiencyVsCon    = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsConPSet));
00119   TpSelectorForEfficiencyVsPhi    = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsPhiPSet));
00120   TpSelectorForEfficiencyVsPt     = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsPtPSet));
00121   TpSelectorForEfficiencyVsVTXR   = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsVTXRPSet));
00122   TpSelectorForEfficiencyVsVTXZ   = new TrackingParticleSelector(ParameterAdapter<TrackingParticleSelector>::make(TpSelectorForEfficiencyVsVTXZPSet));
00123   
00124   generalGpSelector               = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(generalGpSelectorPSet));
00125   GpSelectorForEfficiencyVsEta    = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsEtaPSet));
00126   GpSelectorForEfficiencyVsCon    = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsEtaPSet));
00127   GpSelectorForEfficiencyVsPhi    = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsPhiPSet));
00128   GpSelectorForEfficiencyVsPt     = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsPtPSet));
00129   GpSelectorForEfficiencyVsVTXR   = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsVTXRPSet));
00130   GpSelectorForEfficiencyVsVTXZ   = new GenParticleCustomSelector(ParameterAdapter<GenParticleCustomSelector>::make(GpSelectorForEfficiencyVsVTXZPSet));
00131 
00132   // fix for the LogScale by Ryan
00133   if(useLogPt){
00134     maxPt=log10(maxPt);
00135     if(minPt > 0){
00136       minPt=log10(minPt);
00137     }
00138     else{
00139       edm::LogWarning("MultiTrackValidator") 
00140         << "minPt = "
00141         << minPt << " <= 0 out of range while requesting log scale.  Using minPt = 0.1.";
00142       minPt=log10(0.1);
00143     }
00144   }
00145 
00146 }
00147 
00148 MTVHistoProducerAlgoForTracker::~MTVHistoProducerAlgoForTracker(){
00149   delete generalTpSelector;
00150   delete TpSelectorForEfficiencyVsEta;
00151   delete TpSelectorForEfficiencyVsCon;
00152   delete TpSelectorForEfficiencyVsPhi;
00153   delete TpSelectorForEfficiencyVsPt;
00154   delete TpSelectorForEfficiencyVsVTXR;
00155   delete TpSelectorForEfficiencyVsVTXZ;
00156 
00157   delete generalGpSelector;
00158   delete GpSelectorForEfficiencyVsEta;
00159   delete GpSelectorForEfficiencyVsCon;
00160   delete GpSelectorForEfficiencyVsPhi;
00161   delete GpSelectorForEfficiencyVsPt;
00162   delete GpSelectorForEfficiencyVsVTXR;
00163   delete GpSelectorForEfficiencyVsVTXZ;
00164 }
00165 
00166 
00167 void MTVHistoProducerAlgoForTracker::setUpVectors(){
00168   std::vector<double> etaintervalsv;
00169   std::vector<double> phiintervalsv;
00170   std::vector<double> pTintervalsv;
00171   std::vector<double> dxyintervalsv;
00172   std::vector<double> dzintervalsv;
00173   std::vector<double> vertposintervalsv;
00174   std::vector<double> zposintervalsv;
00175   std::vector<double> vertcountintervalsv;
00176 
00177   std::vector<int>    totSIMveta,totASSveta,totASS2veta,totloopveta,totmisidveta,totASS2vetaSig,totRECveta;
00178   std::vector<int>    totSIMvpT,totASSvpT,totASS2vpT,totRECvpT,totloopvpT,totmisidvpT;
00179   std::vector<int>    totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit,totloopv_hit,totmisidv_hit;
00180   std::vector<int>    totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi,totloopv_phi,totmisidv_phi;
00181   std::vector<int>    totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy,totloopv_dxy,totmisidv_dxy;
00182   std::vector<int>    totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz,totloopv_dz,totmisidv_dz;
00183 
00184   std::vector<int>    totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos; 
00185   std::vector<int>    totSIMv_vertcount,totASSv_vertcount,totRECv_vertcount,totASS2v_vertcount; 
00186   std::vector<int>    totRECv_algo;
00187 
00188   double step=(maxEta-minEta)/nintEta;
00189   //std::ostringstream title,name; ///BM, what is this?
00190   etaintervalsv.push_back(minEta);
00191   for (int k=1;k<nintEta+1;k++) {
00192     double d=minEta+k*step;
00193     etaintervalsv.push_back(d);
00194     totSIMveta.push_back(0);
00195     totASSveta.push_back(0);
00196     totASS2veta.push_back(0);
00197     totloopveta.push_back(0);
00198     totmisidveta.push_back(0);
00199     totASS2vetaSig.push_back(0);
00200     totRECveta.push_back(0);
00201   }   
00202   etaintervals.push_back(etaintervalsv);
00203   totSIMeta.push_back(totSIMveta);
00204   totCONeta.push_back(totASSveta);
00205   totASSeta.push_back(totASSveta);
00206   totASS2eta.push_back(totASS2veta);
00207   totloopeta.push_back(totloopveta);
00208   totmisideta.push_back(totmisidveta);
00209   totASS2etaSig.push_back(totASS2vetaSig);
00210   totRECeta.push_back(totRECveta);
00211   totFOMT_eta.push_back(totASSveta);
00212     
00213   totASS2_itpu_eta_entire.push_back(totASS2veta);
00214   totASS2_itpu_eta_entire_signal.push_back(totASS2vetaSig);
00215   totASS2_ootpu_eta_entire.push_back(totASS2veta);
00216 
00217   for (size_t i = 0; i < 15; i++) {
00218     totRECv_algo.push_back(0);
00219   }
00220   totREC_algo.push_back(totRECv_algo);
00221 
00222   double stepPt = (maxPt-minPt)/nintPt;
00223   pTintervalsv.push_back(minPt);
00224   for (int k=1;k<nintPt+1;k++) {
00225     double d=0;
00226     if(useLogPt)d=pow(10,minPt+k*stepPt);
00227     else d=minPt+k*stepPt;
00228     pTintervalsv.push_back(d);
00229     totSIMvpT.push_back(0);
00230     totASSvpT.push_back(0);
00231     totASS2vpT.push_back(0);
00232     totRECvpT.push_back(0);
00233     totloopvpT.push_back(0);
00234     totmisidvpT.push_back(0);
00235   }
00236   pTintervals.push_back(pTintervalsv);
00237   totSIMpT.push_back(totSIMvpT);
00238   totASSpT.push_back(totASSvpT);
00239   totASS2pT.push_back(totASS2vpT);
00240   totRECpT.push_back(totRECvpT);
00241   totlooppT.push_back(totloopvpT);
00242   totmisidpT.push_back(totmisidvpT);
00243   
00244   for (int k=1;k<nintHit+1;k++) {
00245     totSIMv_hit.push_back(0);
00246     totASSv_hit.push_back(0);
00247     totASS2v_hit.push_back(0);
00248     totRECv_hit.push_back(0);
00249     totloopv_hit.push_back(0);
00250     totmisidv_hit.push_back(0);
00251   }
00252   totSIM_hit.push_back(totSIMv_hit);
00253   totASS_hit.push_back(totASSv_hit);
00254   totASS2_hit.push_back(totASS2v_hit);
00255   totREC_hit.push_back(totRECv_hit);
00256   totloop_hit.push_back(totloopv_hit);
00257   totmisid_hit.push_back(totmisidv_hit);
00258   
00259   double stepPhi = (maxPhi-minPhi)/nintPhi;
00260   phiintervalsv.push_back(minPhi);
00261   for (int k=1;k<nintPhi+1;k++) {
00262     double d=minPhi+k*stepPhi;
00263     phiintervalsv.push_back(d);
00264     totSIMv_phi.push_back(0);
00265     totASSv_phi.push_back(0);
00266     totASS2v_phi.push_back(0);
00267     totRECv_phi.push_back(0);
00268     totloopv_phi.push_back(0);
00269     totmisidv_phi.push_back(0);
00270   }
00271   phiintervals.push_back(phiintervalsv);
00272   totSIM_phi.push_back(totSIMv_phi);
00273   totASS_phi.push_back(totASSv_phi);
00274   totASS2_phi.push_back(totASS2v_phi);
00275   totREC_phi.push_back(totRECv_phi);
00276   totloop_phi.push_back(totloopv_phi);
00277   totmisid_phi.push_back(totmisidv_phi);
00278   
00279   double stepDxy = (maxDxy-minDxy)/nintDxy;
00280   dxyintervalsv.push_back(minDxy);
00281   for (int k=1;k<nintDxy+1;k++) {
00282     double d=minDxy+k*stepDxy;
00283     dxyintervalsv.push_back(d);
00284     totSIMv_dxy.push_back(0);
00285     totASSv_dxy.push_back(0);
00286     totASS2v_dxy.push_back(0);
00287     totRECv_dxy.push_back(0);
00288     totloopv_dxy.push_back(0);
00289     totmisidv_dxy.push_back(0);
00290   }
00291   dxyintervals.push_back(dxyintervalsv);
00292   totSIM_dxy.push_back(totSIMv_dxy);
00293   totASS_dxy.push_back(totASSv_dxy);
00294   totASS2_dxy.push_back(totASS2v_dxy);
00295   totREC_dxy.push_back(totRECv_dxy);
00296   totloop_dxy.push_back(totloopv_dxy);
00297   totmisid_dxy.push_back(totmisidv_dxy);
00298   
00299   
00300   double stepDz = (maxDz-minDz)/nintDz;
00301   dzintervalsv.push_back(minDz);
00302   for (int k=1;k<nintDz+1;k++) {
00303     double d=minDz+k*stepDz;
00304     dzintervalsv.push_back(d);
00305     totSIMv_dz.push_back(0);
00306     totASSv_dz.push_back(0);
00307     totASS2v_dz.push_back(0);
00308     totRECv_dz.push_back(0);
00309     totloopv_dz.push_back(0);
00310     totmisidv_dz.push_back(0);
00311   }
00312   dzintervals.push_back(dzintervalsv);
00313   totSIM_dz.push_back(totSIMv_dz);
00314   totASS_dz.push_back(totASSv_dz);
00315   totASS2_dz.push_back(totASS2v_dz);
00316   totREC_dz.push_back(totRECv_dz);
00317   totloop_dz.push_back(totloopv_dz);
00318   totmisid_dz.push_back(totmisidv_dz);
00319   
00320   double stepVertpos = (maxVertpos-minVertpos)/nintVertpos;
00321   vertposintervalsv.push_back(minVertpos);
00322   for (int k=1;k<nintVertpos+1;k++) {
00323     double d=minVertpos+k*stepVertpos;
00324     vertposintervalsv.push_back(d);
00325     totSIMv_vertpos.push_back(0);
00326     totASSv_vertpos.push_back(0);
00327   }
00328   vertposintervals.push_back(vertposintervalsv);
00329   totSIM_vertpos.push_back(totSIMv_vertpos);
00330   totASS_vertpos.push_back(totASSv_vertpos);
00331     
00332   double stepZpos = (maxZpos-minZpos)/nintZpos;
00333   zposintervalsv.push_back(minZpos);
00334   for (int k=1;k<nintZpos+1;k++) {
00335     double d=minZpos+k*stepZpos;
00336     zposintervalsv.push_back(d);
00337     totSIMv_zpos.push_back(0);
00338     totASSv_zpos.push_back(0);
00339   }
00340   zposintervals.push_back(zposintervalsv);
00341   totSIM_zpos.push_back(totSIMv_zpos);
00342   totCONzpos.push_back(totSIMv_zpos);
00343   totASS_zpos.push_back(totASSv_zpos);
00344   totSIM_vertz_entire.push_back(totSIMv_zpos);
00345   totASS_vertz_entire.push_back(totASSv_zpos);
00346   totSIM_vertz_barrel.push_back(totSIMv_zpos);
00347   totASS_vertz_barrel.push_back(totASSv_zpos);
00348   totSIM_vertz_fwdpos.push_back(totSIMv_zpos);
00349   totASS_vertz_fwdpos.push_back(totASSv_zpos);
00350   totSIM_vertz_fwdneg.push_back(totSIMv_zpos);
00351   totASS_vertz_fwdneg.push_back(totASSv_zpos);
00352 
00353   double stepVertcount=(maxVertcount-minVertcount)/nintVertcount;
00354   vertcountintervalsv.push_back(minVertcount);
00355   for (int k=1;k<nintVertcount+1;k++) {
00356     double d=minVertcount+k*stepVertcount;
00357     vertcountintervalsv.push_back(d);
00358     totSIMv_vertcount.push_back(0);
00359     totASSv_vertcount.push_back(0);
00360     totASS2v_vertcount.push_back(0);
00361     totRECv_vertcount.push_back(0);
00362   }   
00363   vertcountintervals.push_back(vertcountintervalsv);
00364   totSIM_vertcount_entire.push_back(totSIMv_vertcount);
00365   totCONvertcount.push_back(totSIMv_vertcount);
00366   totASS_vertcount_entire.push_back(totASSv_vertcount);
00367   totASS2_vertcount_entire.push_back(totASS2v_vertcount);
00368   totASS2_vertcount_entire_signal.push_back(totASS2v_vertcount);
00369   totREC_vertcount_entire.push_back(totRECv_vertcount);
00370   totSIM_vertcount_barrel.push_back(totSIMv_vertcount);
00371   totASS_vertcount_barrel.push_back(totASSv_vertcount);
00372   totASS2_vertcount_barrel.push_back(totASS2v_vertcount);
00373   totREC_vertcount_barrel.push_back(totRECv_vertcount);
00374   totSIM_vertcount_fwdpos.push_back(totSIMv_vertcount);
00375   totASS_vertcount_fwdpos.push_back(totASSv_vertcount);
00376   totASS2_vertcount_fwdpos.push_back(totASS2v_vertcount);
00377   totREC_vertcount_fwdpos.push_back(totRECv_vertcount);
00378   totSIM_vertcount_fwdneg.push_back(totSIMv_vertcount);
00379   totASS_vertcount_fwdneg.push_back(totASSv_vertcount);
00380   totASS2_vertcount_fwdneg.push_back(totASS2v_vertcount);
00381   totREC_vertcount_fwdneg.push_back(totRECv_vertcount);
00382   totFOMT_vertcount.push_back(totASSv_vertcount);
00383     
00384   totASS2_itpu_vertcount_entire.push_back(totASS2v_vertcount);
00385   totASS2_itpu_vertcount_entire_signal.push_back(totASS2v_vertcount);
00386 
00387   totASS2_ootpu_entire.push_back(totASS2v_vertcount);
00388   totREC_ootpu_entire.push_back(totRECv_vertcount);
00389   totASS2_ootpu_barrel.push_back(totASS2v_vertcount);
00390   totREC_ootpu_barrel.push_back(totRECv_vertcount);
00391   totASS2_ootpu_fwdpos.push_back(totASS2v_vertcount);
00392   totREC_ootpu_fwdpos.push_back(totRECv_vertcount);
00393   totASS2_ootpu_fwdneg.push_back(totASS2v_vertcount);
00394   totREC_ootpu_fwdneg.push_back(totRECv_vertcount);
00395 
00396 }
00397 
00398 void MTVHistoProducerAlgoForTracker::bookSimHistos(){
00399   h_ptSIM.push_back( dbe_->book1D("ptSIM", "generated p_{t}", 5500, 0, 110 ) );
00400   h_etaSIM.push_back( dbe_->book1D("etaSIM", "generated pseudorapidity", 500, -2.5, 2.5 ) );
00401   h_tracksSIM.push_back( dbe_->book1D("tracksSIM","number of simulated tracks",200,-0.5,99.5) );
00402   h_vertposSIM.push_back( dbe_->book1D("vertposSIM","Transverse position of sim vertices",100,0.,120.) );  
00403   h_bunchxSIM.push_back( dbe_->book1D("bunchxSIM", "bunch crossing", 22, -5, 5 ) );
00404 }
00405 
00406 
00407 void MTVHistoProducerAlgoForTracker::bookRecoHistos(){
00408   h_tracks.push_back( dbe_->book1D("tracks","number of reconstructed tracks",401,-0.5,400.5) );
00409   h_fakes.push_back( dbe_->book1D("fakes","number of fake reco tracks",101,-0.5,100.5) );
00410   h_charge.push_back( dbe_->book1D("charge","charge",3,-1.5,1.5) );
00411   
00412   h_hits.push_back( dbe_->book1D("hits", "number of hits per track", nintHit,minHit,maxHit ) );
00413   h_losthits.push_back( dbe_->book1D("losthits", "number of lost hits per track", nintHit,minHit,maxHit) );
00414   h_nchi2.push_back( dbe_->book1D("chi2", "normalized #chi^{2}", 200, 0, 20 ) );
00415   h_nchi2_prob.push_back( dbe_->book1D("chi2_prob", "normalized #chi^{2} probability",100,0,1));
00416 
00417   h_algo.push_back( dbe_->book1D("h_algo","Tracks by algo",15,0.0,15.0) );
00418 
00420   h_recoeta.push_back( dbe_->book1D("num_reco_eta","N of reco track vs eta",nintEta,minEta,maxEta) );
00421   h_assoceta.push_back( dbe_->book1D("num_assoc(simToReco)_eta","N of associated tracks (simToReco) vs eta",nintEta,minEta,maxEta) );
00422   h_assoc2eta.push_back( dbe_->book1D("num_assoc(recoToSim)_eta","N of associated (recoToSim) tracks vs eta",nintEta,minEta,maxEta) );
00423   h_simuleta.push_back( dbe_->book1D("num_simul_eta","N of simulated tracks vs eta",nintEta,minEta,maxEta) );
00424   h_loopereta.push_back( dbe_->book1D("num_duplicate_eta","N of associated (recoToSim) duplicate tracks vs eta",nintEta,minEta,maxEta) );
00425   h_misideta.push_back( dbe_->book1D("num_chargemisid_eta","N of associated (recoToSim) charge misIDed tracks vs eta",nintEta,minEta,maxEta) );
00426   h_recopT.push_back( dbe_->book1D("num_reco_pT","N of reco track vs pT",nintPt,minPt,maxPt) );
00427   h_assocpT.push_back( dbe_->book1D("num_assoc(simToReco)_pT","N of associated tracks (simToReco) vs pT",nintPt,minPt,maxPt) );
00428   h_assoc2pT.push_back( dbe_->book1D("num_assoc(recoToSim)_pT","N of associated (recoToSim) tracks vs pT",nintPt,minPt,maxPt) );
00429   h_simulpT.push_back( dbe_->book1D("num_simul_pT","N of simulated tracks vs pT",nintPt,minPt,maxPt) );
00430   h_looperpT.push_back( dbe_->book1D("num_duplicate_pT","N of associated (recoToSim) duplicate tracks vs pT",nintPt,minPt,maxPt) );
00431   h_misidpT.push_back( dbe_->book1D("num_chargemisid_pT","N of associated (recoToSim) charge misIDed tracks vs pT",nintPt,minPt,maxPt) );
00432   //
00433   h_recohit.push_back( dbe_->book1D("num_reco_hit","N of reco track vs hit",nintHit,minHit,maxHit) );
00434   h_assochit.push_back( dbe_->book1D("num_assoc(simToReco)_hit","N of associated tracks (simToReco) vs hit",nintHit,minHit,maxHit) );
00435   h_assoc2hit.push_back( dbe_->book1D("num_assoc(recoToSim)_hit","N of associated (recoToSim) tracks vs hit",nintHit,minHit,maxHit) );
00436   h_simulhit.push_back( dbe_->book1D("num_simul_hit","N of simulated tracks vs hit",nintHit,minHit,maxHit) );
00437   h_looperhit.push_back( dbe_->book1D("num_duplicate_hit","N of associated (recoToSim) duplicate tracks vs hit",nintHit,minHit,maxHit) );
00438   h_misidhit.push_back( dbe_->book1D("num_chargemisid_hit","N of associated (recoToSim) charge misIDed tracks vs hit",nintHit,minHit,maxHit) );
00439   //
00440   h_recophi.push_back( dbe_->book1D("num_reco_phi","N of reco track vs phi",nintPhi,minPhi,maxPhi) );
00441   h_assocphi.push_back( dbe_->book1D("num_assoc(simToReco)_phi","N of associated tracks (simToReco) vs phi",nintPhi,minPhi,maxPhi) );
00442   h_assoc2phi.push_back( dbe_->book1D("num_assoc(recoToSim)_phi","N of associated (recoToSim) tracks vs phi",nintPhi,minPhi,maxPhi) );
00443   h_simulphi.push_back( dbe_->book1D("num_simul_phi","N of simulated tracks vs phi",nintPhi,minPhi,maxPhi) );
00444   h_looperphi.push_back( dbe_->book1D("num_duplicate_phi","N of associated (recoToSim) duplicate tracks vs phi",nintPhi,minPhi,maxPhi) );
00445   h_misidphi.push_back( dbe_->book1D("num_chargemisid_phi","N of associated (recoToSim) charge misIDed tracks vs phi",nintPhi,minPhi,maxPhi) );
00446   
00447   h_recodxy.push_back( dbe_->book1D("num_reco_dxy","N of reco track vs dxy",nintDxy,minDxy,maxDxy) );
00448   h_assocdxy.push_back( dbe_->book1D("num_assoc(simToReco)_dxy","N of associated tracks (simToReco) vs dxy",nintDxy,minDxy,maxDxy) );
00449   h_assoc2dxy.push_back( dbe_->book1D("num_assoc(recoToSim)_dxy","N of associated (recoToSim) tracks vs dxy",nintDxy,minDxy,maxDxy) );
00450   h_simuldxy.push_back( dbe_->book1D("num_simul_dxy","N of simulated tracks vs dxy",nintDxy,minDxy,maxDxy) );
00451   h_looperdxy.push_back( dbe_->book1D("num_duplicate_dxy","N of associated (recoToSim) looper tracks vs dxy",nintDxy,minDxy,maxDxy) );
00452   h_misiddxy.push_back( dbe_->book1D("num_chargemisid_dxy","N of associated (recoToSim) charge misIDed tracks vs dxy",nintDxy,minDxy,maxDxy) );
00453   
00454   h_recodz.push_back( dbe_->book1D("num_reco_dz","N of reco track vs dz",nintDz,minDz,maxDz) );
00455   h_assocdz.push_back( dbe_->book1D("num_assoc(simToReco)_dz","N of associated tracks (simToReco) vs dz",nintDz,minDz,maxDz) );
00456   h_assoc2dz.push_back( dbe_->book1D("num_assoc(recoToSim)_dz","N of associated (recoToSim) tracks vs dz",nintDz,minDz,maxDz) );
00457   h_simuldz.push_back( dbe_->book1D("num_simul_dz","N of simulated tracks vs dz",nintDz,minDz,maxDz) );
00458   h_looperdz.push_back( dbe_->book1D("num_duplicate_dz","N of associated (recoToSim) looper tracks vs dz",nintDz,minDz,maxDz) );
00459   h_misiddz.push_back( dbe_->book1D("num_chargemisid_versus_dz","N of associated (recoToSim) charge misIDed tracks vs dz",nintDz,minDz,maxDz) );
00460   
00461   h_assocvertpos.push_back( dbe_->book1D("num_assoc(simToReco)_vertpos",
00462                                          "N of associated tracks (simToReco) vs transverse vert position",       
00463                                          nintVertpos,minVertpos,maxVertpos) );
00464   h_simulvertpos.push_back( dbe_->book1D("num_simul_vertpos","N of simulated tracks vs transverse vert position",
00465                                          nintVertpos,minVertpos,maxVertpos) );
00466   
00467   h_assoczpos.push_back( dbe_->book1D("num_assoc(simToReco)_zpos","N of associated tracks (simToReco) vs z vert position",
00468                                       nintZpos,minZpos,maxZpos) );
00469   h_simulzpos.push_back( dbe_->book1D("num_simul_zpos","N of simulated tracks vs z vert position",nintZpos,minZpos,maxZpos) );
00470   
00471 
00472   h_reco_vertcount_entire.push_back( dbe_->book1D("num_reco_vertcount_entire","N of reco tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00473   h_assoc_vertcount_entire.push_back( dbe_->book1D("num_assoc(simToReco)_vertcount_entire","N of associated tracks (simToReco) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00474   h_assoc2_vertcount_entire.push_back( dbe_->book1D("num_assoc(recoToSim)_vertcount_entire","N of associated (recoToSim) tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00475   h_simul_vertcount_entire.push_back( dbe_->book1D("num_simul_vertcount_entire","N of simulated tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00476 
00477   h_reco_vertcount_barrel.push_back( dbe_->book1D("num_reco_vertcount_barrel","N of reco tracks in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00478   h_assoc_vertcount_barrel.push_back( dbe_->book1D("num_assoc(simToReco)_vertcount_barrel","N of associated tracks (simToReco) in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00479   h_assoc2_vertcount_barrel.push_back( dbe_->book1D("num_assoc(recoToSim)_vertcount_barrel","N of associated (recoToSim) tracks in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00480   h_simul_vertcount_barrel.push_back( dbe_->book1D("num_simul_vertcount_barrel","N of simulated tracks in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00481 
00482   h_reco_vertcount_fwdpos.push_back( dbe_->book1D("num_reco_vertcount_fwdpos","N of reco tracks in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00483   h_assoc_vertcount_fwdpos.push_back( dbe_->book1D("num_assoc(simToReco)_vertcount_fwdpos","N of associated tracks (simToReco) in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00484   h_assoc2_vertcount_fwdpos.push_back( dbe_->book1D("num_assoc(recoToSim)_vertcount_fwdpos","N of associated (recoToSim) tracks in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00485   h_simul_vertcount_fwdpos.push_back( dbe_->book1D("num_simul_vertcount_fwdpos","N of simulated tracks in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00486 
00487   h_reco_vertcount_fwdneg.push_back( dbe_->book1D("num_reco_vertcount_fwdneg","N of reco tracks in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00488   h_assoc_vertcount_fwdneg.push_back( dbe_->book1D("num_assoc(simToReco)_vertcount_fwdneg","N of associated tracks (simToReco) in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00489   h_assoc2_vertcount_fwdneg.push_back( dbe_->book1D("num_assoc(recoToSim)_vertcount_fwdneg","N of associated (recoToSim) tracks in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00490   h_simul_vertcount_fwdneg.push_back( dbe_->book1D("num_simul_vertcount_fwdneg","N of simulated tracks in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00491 
00492   h_assoc_vertz_entire.push_back( dbe_->book1D("num_assoc(simToReco)_vertz_entire","N of associated tracks (simToReco) in entire vs z of primary intercation vertex",nintZpos,minZpos,maxZpos) );
00493   h_simul_vertz_entire.push_back( dbe_->book1D("num_simul_vertz_entire","N of simulated tracks in entire vs N of pileup vertices",nintZpos,minZpos,maxZpos) );
00494 
00495   h_assoc_vertz_barrel.push_back( dbe_->book1D("num_assoc(simToReco)_vertz_barrel","N of associated tracks (simToReco) in barrel vs z of primary intercation vertex",nintZpos,minZpos,maxZpos) );
00496   h_simul_vertz_barrel.push_back( dbe_->book1D("num_simul_vertz_barrel","N of simulated tracks in barrel vs N of pileup vertices",nintZpos,minZpos,maxZpos) );
00497 
00498   h_assoc_vertz_fwdpos.push_back( dbe_->book1D("num_assoc(simToReco)_vertz_fwdpos","N of associated tracks (simToReco) in endcap(+) vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00499   h_simul_vertz_fwdpos.push_back( dbe_->book1D("num_simul_vertz_fwdpos","N of simulated tracks in endcap(+) vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00500 
00501   h_assoc_vertz_fwdneg.push_back( dbe_->book1D("num_assoc(simToReco)_vertz_fwdneg","N of associated tracks (simToReco) in endcap(-) vs N of pileup vertices",nintZpos,minZpos,maxZpos) );
00502   h_simul_vertz_fwdneg.push_back( dbe_->book1D("num_simul_vertz_fwdneg","N of simulated tracks in endcap(-) vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00503 /*
00504   h_assoc2_itpu_eta.push_back( dbe_->book1D("num_assoc(recoToSim)_itpu_eta_entire","N of associated tracks (simToReco) from in time pileup vs eta",nintEta,minEta,maxEta) );
00505   h_assoc2_itpu_sig_eta.push_back( dbe_->book1D("num_assoc(recoToSim)_itpu_eta_entire_signal","N of associated tracks (simToReco) from in time pileup vs eta",nintEta,minEta,maxEta) );
00506   h_assoc2_itpu_vertcount.push_back( dbe_->book1D("num_assoc(recoToSim)_itpu_vertcount_entire","N of associated tracks (simToReco) from in time pileup vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00507   h_assoc2_itpu_sig_vertcount.push_back( dbe_->book1D("num_assoc(recoToSim)_itpu_vertcount_entire_signal","N of associated tracks (simToReco) from in time pileup vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );*/
00508 
00509   h_reco_ootpu_eta.push_back( dbe_->book1D("num_reco_ootpu_eta_entire","N of reco tracks vs eta",nintEta,minEta,maxEta) );
00510   h_reco_ootpu_vertcount.push_back( dbe_->book1D("num_reco_ootpu_vertcount_entire","N of reco tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00511 
00512   h_assoc2_ootpu_entire.push_back( dbe_->book1D("num_assoc(recoToSim)_ootpu_eta_entire","N of associated tracks (simToReco) from out of time pileup vs eta",nintEta,minEta,maxEta) );
00513   h_assoc2_ootpu_vertcount.push_back( dbe_->book1D("num_assoc(recoToSim)_ootpu_vertcount_entire","N of associated tracks (simToReco) from out of time pileup vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00514 
00515   h_reco_ootpu_entire.push_back( dbe_->book1D("num_reco_ootpu_entire","N of reco tracks vs z of primary interaction vertex",nintVertcount,minVertcount,maxVertcount) );
00516   h_assoc2_ootpu_barrel.push_back( dbe_->book1D("num_assoc(recoToSim)_ootpu_barrel","N of associated tracks (simToReco) from out of time pileup in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00517   h_reco_ootpu_barrel.push_back( dbe_->book1D("num_reco_ootpu_barrel","N of reco tracks in barrel vs z of primary interaction vertex",nintVertcount,minVertcount,maxVertcount) );
00518   h_assoc2_ootpu_fwdpos.push_back( dbe_->book1D("num_assoc(recoToSim)_ootpu_fwdpos","N of associated tracks (simToReco) from out of time pileup in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00519   h_reco_ootpu_fwdpos.push_back( dbe_->book1D("num_reco_ootpu_fwdpos","N of reco tracks in endcap(+) vs z of primary interaction vertex",nintVertcount,minVertcount,maxVertcount) );
00520   h_assoc2_ootpu_fwdneg.push_back( dbe_->book1D("num_assoc(recoToSim)_ootpu_fwdneg","N of associated tracks (simToReco) from out of time pileup in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00521   h_reco_ootpu_fwdneg.push_back( dbe_->book1D("num_reco_ootpu_fwdneg","N of reco tracks in endcap(-) vs z of primary interaction vertex",nintVertcount,minVertcount,maxVertcount) );
00522 
00523 
00525   
00526   h_eta.push_back( dbe_->book1D("eta", "pseudorapidity residue", 1000, -0.1, 0.1 ) );
00527   h_pt.push_back( dbe_->book1D("pullPt", "pull of p_{t}", 100, -10, 10 ) );
00528   h_pullTheta.push_back( dbe_->book1D("pullTheta","pull of #theta parameter",250,-25,25) );
00529   h_pullPhi.push_back( dbe_->book1D("pullPhi","pull of #phi parameter",250,-25,25) );
00530   h_pullDxy.push_back( dbe_->book1D("pullDxy","pull of dxy parameter",250,-25,25) );
00531   h_pullDz.push_back( dbe_->book1D("pullDz","pull of dz parameter",250,-25,25) );
00532   h_pullQoverp.push_back( dbe_->book1D("pullQoverp","pull of qoverp parameter",250,-25,25) );
00533   
00534   /* TO BE FIXED -----------
00535   if (associators[ww]=="TrackAssociatorByChi2"){
00536     h_assochi2.push_back( dbe_->book1D("assocChi2","track association #chi^{2}",1000000,0,100000) );
00537     h_assochi2_prob.push_back(dbe_->book1D("assocChi2_prob","probability of association #chi^{2}",100,0,1));
00538   } else if (associators[ww]=="quickTrackAssociatorByHits"){
00539     h_assocFraction.push_back( dbe_->book1D("assocFraction","fraction of shared hits",200,0,2) );
00540     h_assocSharedHit.push_back(dbe_->book1D("assocSharedHit","number of shared hits",20,0,20));
00541   }
00542   */
00543   h_assocFraction.push_back( dbe_->book1D("assocFraction","fraction of shared hits",200,0,2) );
00544   h_assocSharedHit.push_back(dbe_->book1D("assocSharedHit","number of shared hits",41,-0.5,40.5));
00545   // ----------------------
00546 
00547   chi2_vs_nhits.push_back( dbe_->book2D("chi2_vs_nhits","#chi^{2} vs nhits",25,0,25,100,0,10) );
00548   
00549   etares_vs_eta.push_back( dbe_->book2D("etares_vs_eta","etaresidue vs eta",nintEta,minEta,maxEta,200,-0.1,0.1) );
00550   nrec_vs_nsim.push_back( dbe_->book2D("nrec_vs_nsim","nrec vs nsim",401,-0.5,400.5,401,-0.5,400.5) );
00551   
00552   chi2_vs_eta.push_back( dbe_->book2D("chi2_vs_eta","chi2_vs_eta",nintEta,minEta,maxEta, 200, 0, 20 ));
00553   chi2_vs_phi.push_back( dbe_->book2D("chi2_vs_phi","#chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 200, 0, 20 ) );
00554   
00555   nhits_vs_eta.push_back( dbe_->book2D("nhits_vs_eta","nhits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00556   nPXBhits_vs_eta.push_back( dbe_->book2D("nPXBhits_vs_eta","# PXB its vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00557   nPXFhits_vs_eta.push_back( dbe_->book2D("nPXFhits_vs_eta","# PXF hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00558   nTIBhits_vs_eta.push_back( dbe_->book2D("nTIBhits_vs_eta","# TIB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00559   nTIDhits_vs_eta.push_back( dbe_->book2D("nTIDhits_vs_eta","# TID hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00560   nTOBhits_vs_eta.push_back( dbe_->book2D("nTOBhits_vs_eta","# TOB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00561   nTEChits_vs_eta.push_back( dbe_->book2D("nTEChits_vs_eta","# TEC hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00562 
00563   nLayersWithMeas_vs_eta.push_back( dbe_->book2D("nLayersWithMeas_vs_eta","# Layers with measurement vs eta",
00564                                                 nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00565   nPXLlayersWithMeas_vs_eta.push_back( dbe_->book2D("nPXLlayersWithMeas_vs_eta","# PXL Layers with measurement vs eta",
00566                                                    nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00567   nSTRIPlayersWithMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWithMeas_vs_eta","# STRIP Layers with measurement vs eta",
00568                                                       nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00569   nSTRIPlayersWith1dMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWith1dMeas_vs_eta","# STRIP Layers with 1D measurement vs eta",
00570                                                         nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00571   nSTRIPlayersWith2dMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWith2dMeas_vs_eta","# STRIP Layers with 2D measurement vs eta",
00572                                                        nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00573   
00574   nhits_vs_phi.push_back( dbe_->book2D("nhits_vs_phi","#hits vs #phi",nintPhi,minPhi,maxPhi,nintHit,minHit,maxHit) );
00575   
00576   nlosthits_vs_eta.push_back( dbe_->book2D("nlosthits_vs_eta","nlosthits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00577   
00578   //resolution of track parameters
00579   //                       dPt/Pt    cotTheta        Phi            TIP            LIP
00580   // log10(pt)<0.5        100,0.1    240,0.08     100,0.015      100,0.1000    150,0.3000
00581   // 0.5<log10(pt)<1.5    100,0.1    120,0.01     100,0.003      100,0.0100    150,0.0500
00582   // >1.5                 100,0.3    100,0.005    100,0.0008     100,0.0060    120,0.0300
00583   
00584   ptres_vs_eta.push_back(dbe_->book2D("ptres_vs_eta","ptres_vs_eta",
00585                                       nintEta,minEta,maxEta, ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax));
00586   
00587   ptres_vs_phi.push_back( dbe_->book2D("ptres_vs_phi","p_{t} res vs #phi",
00588                                        nintPhi,minPhi,maxPhi, ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax));
00589   
00590   ptres_vs_pt.push_back(dbe_->book2D("ptres_vs_pt","ptres_vs_pt",nintPt,minPt,maxPt, ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax));
00591   
00592   cotThetares_vs_eta.push_back(dbe_->book2D("cotThetares_vs_eta","cotThetares_vs_eta",
00593                                             nintEta,minEta,maxEta,cotThetaRes_nbin, cotThetaRes_rangeMin, cotThetaRes_rangeMax));
00594 
00595   
00596   cotThetares_vs_pt.push_back(dbe_->book2D("cotThetares_vs_pt","cotThetares_vs_pt",
00597                                            nintPt,minPt,maxPt, cotThetaRes_nbin, cotThetaRes_rangeMin, cotThetaRes_rangeMax));      
00598 
00599 
00600   phires_vs_eta.push_back(dbe_->book2D("phires_vs_eta","phires_vs_eta",
00601                                        nintEta,minEta,maxEta, phiRes_nbin, phiRes_rangeMin, phiRes_rangeMax));
00602 
00603   phires_vs_pt.push_back(dbe_->book2D("phires_vs_pt","phires_vs_pt",
00604                                       nintPt,minPt,maxPt, phiRes_nbin, phiRes_rangeMin, phiRes_rangeMax));
00605 
00606   phires_vs_phi.push_back(dbe_->book2D("phires_vs_phi","#phi res vs #phi",
00607                                        nintPhi,minPhi,maxPhi,phiRes_nbin, phiRes_rangeMin, phiRes_rangeMax));
00608 
00609   dxyres_vs_eta.push_back(dbe_->book2D("dxyres_vs_eta","dxyres_vs_eta",
00610                                        nintEta,minEta,maxEta,dxyRes_nbin, dxyRes_rangeMin, dxyRes_rangeMax));
00611   
00612   dxyres_vs_pt.push_back( dbe_->book2D("dxyres_vs_pt","dxyres_vs_pt",
00613                                        nintPt,minPt,maxPt,dxyRes_nbin, dxyRes_rangeMin, dxyRes_rangeMax));
00614   
00615   dzres_vs_eta.push_back(dbe_->book2D("dzres_vs_eta","dzres_vs_eta",
00616                                       nintEta,minEta,maxEta,dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax));
00617 
00618   dzres_vs_pt.push_back(dbe_->book2D("dzres_vs_pt","dzres_vs_pt",nintPt,minPt,maxPt,dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax));
00619   
00620   ptmean_vs_eta_phi.push_back(dbe_->bookProfile2D("ptmean_vs_eta_phi","mean p_{t} vs #eta and #phi",
00621                                                   nintPhi,minPhi,maxPhi,nintEta,minEta,maxEta,1000,0,1000));
00622   phimean_vs_eta_phi.push_back(dbe_->bookProfile2D("phimean_vs_eta_phi","mean #phi vs #eta and #phi",
00623                                                    nintPhi,minPhi,maxPhi,nintEta,minEta,maxEta,nintPhi,minPhi,maxPhi));
00624   
00625   //pulls of track params vs eta: to be used with fitslicesytool
00626   dxypull_vs_eta.push_back(dbe_->book2D("dxypull_vs_eta","dxypull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
00627   ptpull_vs_eta.push_back(dbe_->book2D("ptpull_vs_eta","ptpull_vs_eta",nintEta,minEta,maxEta,100,-10,10)); 
00628   dzpull_vs_eta.push_back(dbe_->book2D("dzpull_vs_eta","dzpull_vs_eta",nintEta,minEta,maxEta,100,-10,10)); 
00629   phipull_vs_eta.push_back(dbe_->book2D("phipull_vs_eta","phipull_vs_eta",nintEta,minEta,maxEta,100,-10,10)); 
00630   thetapull_vs_eta.push_back(dbe_->book2D("thetapull_vs_eta","thetapull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
00631   
00632   //      h_ptshiftetamean.push_back( dbe_->book1D("h_ptshifteta_Mean","<#deltapT/pT>[%] vs #eta",nintEta,minEta,maxEta) ); 
00633   
00634 
00635   //pulls of track params vs phi
00636   ptpull_vs_phi.push_back(dbe_->book2D("ptpull_vs_phi","p_{t} pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10)); 
00637   phipull_vs_phi.push_back(dbe_->book2D("phipull_vs_phi","#phi pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10)); 
00638   thetapull_vs_phi.push_back(dbe_->book2D("thetapull_vs_phi","#theta pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
00639 
00640   
00641   nrecHit_vs_nsimHit_sim2rec.push_back( dbe_->book2D("nrecHit_vs_nsimHit_sim2rec","nrecHit vs nsimHit (Sim2RecAssoc)",
00642                                                      nintHit,minHit,maxHit, nintHit,minHit,maxHit ));
00643   nrecHit_vs_nsimHit_rec2sim.push_back( dbe_->book2D("nrecHit_vs_nsimHit_rec2sim","nrecHit vs nsimHit (Rec2simAssoc)",
00644                                                      nintHit,minHit,maxHit, nintHit,minHit,maxHit ));
00645 
00646   // dE/dx stuff
00647   // FIXME: it would be nice to have an array
00648   h_dedx_estim1.push_back( dbe_->book1D("h_dedx_estim1","dE/dx estimator 1",nintDeDx,minDeDx,maxDeDx) ); 
00649   h_dedx_estim2.push_back( dbe_->book1D("h_dedx_estim2","dE/dx estimator 2",nintDeDx,minDeDx,maxDeDx) ); 
00650   h_dedx_nom1.push_back( dbe_->book1D("h_dedx_nom1","dE/dx number of measurements",nintHit,minHit,maxHit) ); 
00651   h_dedx_nom2.push_back( dbe_->book1D("h_dedx_nom2","dE/dx number of measurements",nintHit,minHit,maxHit) ); 
00652   h_dedx_sat1.push_back( dbe_->book1D("h_dedx_sat1","dE/dx number of measurements with saturation",nintHit,minHit,maxHit) ); 
00653   h_dedx_sat2.push_back( dbe_->book1D("h_dedx_sat2","dE/dx number of measurements with saturation",nintHit,minHit,maxHit) ); 
00654 
00655   // PU special stuff
00656   h_con_eta.push_back( dbe_->book1D("num_con_eta","N of PU tracks vs eta",nintEta,minEta,maxEta) );
00657   h_con_vertcount.push_back( dbe_->book1D("num_con_vertcount","N of PU tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00658   h_con_zpos.push_back( dbe_->book1D("num_con_zpos","N of PU tracks vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00659 
00660 
00661   if(useLogPt){
00662     BinLogX(dzres_vs_pt.back()->getTH2F());
00663     BinLogX(dxyres_vs_pt.back()->getTH2F());
00664     BinLogX(phires_vs_pt.back()->getTH2F());
00665     BinLogX(cotThetares_vs_pt.back()->getTH2F());
00666     BinLogX(ptres_vs_pt.back()->getTH2F());
00667     BinLogX(h_looperpT.back()->getTH1F());
00668     BinLogX(h_misidpT.back()->getTH1F());
00669     BinLogX(h_recopT.back()->getTH1F());
00670     BinLogX(h_assocpT.back()->getTH1F());
00671     BinLogX(h_assoc2pT.back()->getTH1F());
00672     BinLogX(h_simulpT.back()->getTH1F());
00673   }  
00674 }
00675 
00676 void MTVHistoProducerAlgoForTracker::bookRecoHistosForStandaloneRunning(){
00677   h_effic.push_back( dbe_->book1D("effic","efficiency vs #eta",nintEta,minEta,maxEta) );
00678   h_efficPt.push_back( dbe_->book1D("efficPt","efficiency vs pT",nintPt,minPt,maxPt) );
00679   h_effic_vs_hit.push_back( dbe_->book1D("effic_vs_hit","effic vs hit",nintHit,minHit,maxHit) );
00680   h_effic_vs_phi.push_back( dbe_->book1D("effic_vs_phi","effic vs phi",nintPhi,minPhi,maxPhi) );
00681   h_effic_vs_dxy.push_back( dbe_->book1D("effic_vs_dxy","effic vs dxy",nintDxy,minDxy,maxDxy) );
00682   h_effic_vs_dz.push_back( dbe_->book1D("effic_vs_dz","effic vs dz",nintDz,minDz,maxDz) );
00683   h_effic_vs_vertpos.push_back( dbe_->book1D("effic_vs_vertpos","effic vs vertpos",nintVertpos,minVertpos,maxVertpos) );
00684   h_effic_vs_zpos.push_back( dbe_->book1D("effic_vs_zpos","effic vs zpos",nintZpos,minZpos,maxZpos) );
00685   h_effic_vertcount_entire.push_back( dbe_->book1D("effic_vertcount_entire","efficiency vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00686   h_effic_vertcount_barrel.push_back( dbe_->book1D("effic_vertcount_barrel","efficiency in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00687   h_effic_vertcount_fwdpos.push_back( dbe_->book1D("effic_vertcount_fwdpos","efficiency in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00688   h_effic_vertcount_fwdneg.push_back( dbe_->book1D("effic_vertcount_fwdneg","efficiency in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00689   h_effic_vertz_entire.push_back( dbe_->book1D("effic_vertz_entire","efficiency vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00690   h_effic_vertz_barrel.push_back( dbe_->book1D("effic_vertz_barrel","efficiency in barrel vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00691   h_effic_vertz_fwdpos.push_back( dbe_->book1D("effic_vertz_fwdpos","efficiency in endcap(+) vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00692   h_effic_vertz_fwdneg.push_back( dbe_->book1D("effic_vertz_fwdneg","efficiency in endcap(-) vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00693 
00694   h_looprate.push_back( dbe_->book1D("duplicatesRate","loop rate vs #eta",nintEta,minEta,maxEta) );
00695   h_misidrate.push_back( dbe_->book1D("chargeMisIdRate","misid rate vs #eta",nintEta,minEta,maxEta) );
00696   h_fakerate.push_back( dbe_->book1D("fakerate","fake rate vs #eta",nintEta,minEta,maxEta) );
00697   h_loopratepT.push_back( dbe_->book1D("duplicatesRate_Pt","loop rate vs pT",nintPt,minPt,maxPt) );
00698   h_misidratepT.push_back( dbe_->book1D("chargeMisIdRate_Pt","misid rate vs pT",nintPt,minPt,maxPt) );
00699   h_fakeratePt.push_back( dbe_->book1D("fakeratePt","fake rate vs pT",nintPt,minPt,maxPt) );
00700   h_loopratehit.push_back( dbe_->book1D("duplicatesRate_hit","loop rate vs hit",nintHit,minHit,maxHit) );
00701   h_misidratehit.push_back( dbe_->book1D("chargeMisIdRate_hit","misid rate vs hit",nintHit,minHit,maxHit) );
00702   h_fake_vs_hit.push_back( dbe_->book1D("fakerate_vs_hit","fake rate vs hit",nintHit,minHit,maxHit) );
00703   h_loopratephi.push_back( dbe_->book1D("duplicatesRate_phi","loop rate vs #phi",nintPhi,minPhi,maxPhi) );
00704   h_misidratephi.push_back( dbe_->book1D("chargeMisIdRate_phi","misid rate vs #phi",nintPhi,minPhi,maxPhi) );
00705   h_fake_vs_phi.push_back( dbe_->book1D("fakerate_vs_phi","fake vs #phi",nintPhi,minPhi,maxPhi) );
00706   h_loopratedxy.push_back( dbe_->book1D("duplicatesRate_dxy","loop rate vs dxy",nintDxy,minDxy,maxDxy) );
00707   h_misidratedxy.push_back( dbe_->book1D("chargeMisIdRate_dxy","misid rate vs dxy",nintDxy,minDxy,maxDxy) );
00708   h_fake_vs_dxy.push_back( dbe_->book1D("fakerate_vs_dxy","fake rate vs dxy",nintDxy,minDxy,maxDxy) );
00709   h_loopratedz.push_back( dbe_->book1D("duplicatesRate_dz","loop rate vs dz",nintDz,minDz,maxDz) );
00710   h_misidratedz.push_back( dbe_->book1D("chargeMisIdRate_dz","misid rate vs dz",nintDz,minDz,maxDz) );
00711   h_fake_vs_dz.push_back( dbe_->book1D("fakerate_vs_dz","fake vs dz",nintDz,minDz,maxDz) );
00712   h_fakerate_vertcount_entire.push_back( dbe_->book1D("fakerate_vertcount_entire","fake rate vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00713   h_fakerate_vertcount_barrel.push_back( dbe_->book1D("fakerate_vertcount_barrel","fake rate in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00714   h_fakerate_vertcount_fwdpos.push_back( dbe_->book1D("fakerate_vertcount_fwdpos","fake rate in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00715   h_fakerate_vertcount_fwdneg.push_back( dbe_->book1D("fakerate_vertcount_fwdneg","fake rate in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00716   h_fakerate_ootpu_entire.push_back( dbe_->book1D("fakerate_ootpu_eta_entire","Out of time pileup fake rate vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00717   h_fakerate_ootpu_barrel.push_back( dbe_->book1D("fakerate_ootpu_barrel","Out of time pileup fake rate in barrel vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00718   h_fakerate_ootpu_fwdpos.push_back( dbe_->book1D("fakerate_ootpu_fwdpos","Out of time pileup fake rate in endcap(+) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00719   h_fakerate_ootpu_fwdneg.push_back( dbe_->book1D("fakerate_ootpu_fwdneg","Out of time pileup fake rate in endcap(-) vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00720 
00721   h_fomt_eta.push_back( dbe_->book1D("fomt","fraction of misreconstructed tracks vs #eta",nintEta,minEta,maxEta) );
00722   h_fomt_sig_eta.push_back( dbe_->book1D("fomt_signal","fraction of misreconstructed tracks vs #eta",nintEta,minEta,maxEta) );
00723   h_fomt_vertcount.push_back( dbe_->book1D("fomt_vertcount","fraction of misreconstructed tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00724   h_fomt_sig_vertcount.push_back( dbe_->book1D("fomt_vertcount_signal","fraction of misreconstructed tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00725   h_fomt_ootpu_eta.push_back( dbe_->book1D("fomt_ootpu_eta","Out of time pileup fraction of misreconstructed tracks vs #eta",nintEta,minEta,maxEta) );
00726   h_fomt_ootpu_vertcount.push_back( dbe_->book1D("fomt_ootpu_vertcount","Out of time pileup fraction of misreconstructed tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00727   h_fomt_itpu_eta.push_back( dbe_->book1D("fomt_itpu_eta","In time pileup fraction of misreconstructed tracks vs eta",nintEta,minEta,maxEta) );
00728   h_fomt_itpu_vertcount.push_back( dbe_->book1D("fomt_itpu_vertcount","In time pileup fraction of misreconstructed tracks vs N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00729 
00730   h_effic_PU_eta.push_back( dbe_->book1D("effic_PU_eta","PU efficiency vs #eta",nintEta,minEta,maxEta) );
00731   h_effic_PU_vertcount.push_back( dbe_->book1D("effic_PU_vertcount","PU efficiency s N of pileup vertices",nintVertcount,minVertcount,maxVertcount) );
00732   h_effic_PU_zpos.push_back( dbe_->book1D("effic_PU_zpos","PU efficiency vs z of primary interaction vertex",nintZpos,minZpos,maxZpos) );
00733 
00734   h_chi2meanhitsh.push_back( dbe_->bookProfile("chi2mean_vs_nhits","mean #chi^{2} vs nhits",25,0,25,100,0,10) );
00735   h_chi2meanh.push_back( dbe_->bookProfile("chi2mean","mean #chi^{2} vs #eta",nintEta,minEta,maxEta, 200, 0, 20) );
00736   h_chi2mean_vs_phi.push_back( dbe_->bookProfile("chi2mean_vs_phi","mean of #chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 200, 0, 20) );
00737 
00738   h_hits_eta.push_back( dbe_->bookProfile("hits_eta","mean #hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00739   h_PXBhits_eta.push_back( dbe_->bookProfile("PXBhits_eta","mean # PXB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00740   h_PXFhits_eta.push_back( dbe_->bookProfile("PXFhits_eta","mean # PXF hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00741   h_TIBhits_eta.push_back( dbe_->bookProfile("TIBhits_eta","mean # TIB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00742   h_TIDhits_eta.push_back( dbe_->bookProfile("TIDhits_eta","mean # TID hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00743   h_TOBhits_eta.push_back( dbe_->bookProfile("TOBhits_eta","mean # TOB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00744   h_TEChits_eta.push_back( dbe_->bookProfile("TEChits_eta","mean # TEC hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00745 
00746   h_LayersWithMeas_eta.push_back(dbe_->bookProfile("LayersWithMeas_eta","mean # LayersWithMeas vs eta",
00747                            nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00748   h_PXLlayersWithMeas_eta.push_back(dbe_->bookProfile("PXLlayersWith2dMeas_eta","mean # PXLlayersWithMeas vs eta",
00749                               nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00750   h_STRIPlayersWithMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWithMeas_eta","mean # STRIPlayersWithMeas vs eta",
00751                             nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00752   h_STRIPlayersWith1dMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWith1dMeas_eta","mean # STRIPlayersWith1dMeas vs eta",
00753                               nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00754   h_STRIPlayersWith2dMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWith2dMeas_eta","mean # STRIPlayersWith2dMeas vs eta",
00755                               nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00756   h_hits_phi.push_back( dbe_->bookProfile("hits_phi","mean #hits vs #phi",nintPhi,minPhi,maxPhi, nintHit,minHit,maxHit) );
00757   h_losthits_eta.push_back( dbe_->bookProfile("losthits_eta","losthits_eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
00758 
00759   h_ptrmsh.push_back( dbe_->book1D("ptres_vs_eta_Sigma","#sigma(#deltap_{t}/p_{t}) vs #eta",nintEta,minEta,maxEta) );
00760   h_ptmeanhPhi.push_back( dbe_->book1D("ptres_vs_phi_Mean","mean of p_{t} resolution vs #phi",nintPhi,minPhi,maxPhi));
00761   h_ptrmshPhi.push_back( dbe_->book1D("ptres_vs_phi_Sigma","#sigma(#deltap_{t}/p_{t}) vs #phi",nintPhi,minPhi,maxPhi) );
00762   h_ptmeanhPt.push_back( dbe_->book1D("ptres_vs_pt_Mean","mean of p_{t} resolution vs p_{t}",nintPt,minPt,maxPt));
00763   h_ptrmshPt.push_back( dbe_->book1D("ptres_vs_pt_Sigma","#sigma(#deltap_{t}/p_{t}) vs pT",nintPt,minPt,maxPt) );
00764   h_cotThetameanh.push_back( dbe_->book1D("cotThetares_vs_eta_Mean","#sigma(cot(#theta)) vs #eta Mean",nintEta,minEta,maxEta) );
00765   h_cotThetarmsh.push_back( dbe_->book1D("cotThetares_vs_eta_Sigma","#sigma(cot(#theta)) vs #eta Sigma",nintEta,minEta,maxEta) );
00766   h_cotThetameanhPt.push_back( dbe_->book1D("cotThetares_vs_pt_Mean","#sigma(cot(#theta)) vs pT Mean",nintPt,minPt,maxPt) );
00767   h_cotThetarmshPt.push_back( dbe_->book1D("cotThetares_vs_pt_Sigma","#sigma(cot(#theta)) vs pT Sigma",nintPt,minPt,maxPt) );
00768   h_phimeanh.push_back(dbe_->book1D("phires_vs_eta_Mean","mean of #phi res vs #eta",nintEta,minEta,maxEta));
00769   h_phirmsh.push_back( dbe_->book1D("phires_vs_eta_Sigma","#sigma(#delta#phi) vs #eta",nintEta,minEta,maxEta) );
00770   h_phimeanhPt.push_back(dbe_->book1D("phires_vs_pt_Mean","mean of #phi res vs pT",nintPt,minPt,maxPt));
00771   h_phirmshPt.push_back( dbe_->book1D("phires_vs_pt_Sigma","#sigma(#delta#phi) vs pT",nintPt,minPt,maxPt) );
00772   h_phimeanhPhi.push_back(dbe_->book1D("phires_vs_phi_Mean","mean of #phi res vs #phi",nintPhi,minPhi,maxPhi));
00773   h_phirmshPhi.push_back( dbe_->book1D("phires_vs_phi_Sigma","#sigma(#delta#phi) vs #phi",nintPhi,minPhi,maxPhi) );
00774   h_dxymeanh.push_back( dbe_->book1D("dxyres_vs_eta_Mean","mean of dxyres vs #eta",nintEta,minEta,maxEta) );
00775   h_dxyrmsh.push_back( dbe_->book1D("dxyres_vs_eta_Sigma","#sigma(#deltadxy) vs #eta",nintEta,minEta,maxEta) );
00776   h_dxymeanhPt.push_back( dbe_->book1D("dxyres_vs_pt_Mean","mean of dxyres vs pT",nintPt,minPt,maxPt) );
00777   h_dxyrmshPt.push_back( dbe_->book1D("dxyres_vs_pt_Sigma","#sigmadxy vs pT",nintPt,minPt,maxPt) );
00778   h_dzmeanh.push_back( dbe_->book1D("dzres_vs_eta_Mean","mean of dzres vs #eta",nintEta,minEta,maxEta) );
00779   h_dzrmsh.push_back( dbe_->book1D("dzres_vs_eta_Sigma","#sigma(#deltadz) vs #eta",nintEta,minEta,maxEta) );
00780   h_dzmeanhPt.push_back( dbe_->book1D("dzres_vs_pt_Mean","mean of dzres vs pT",nintPt,minPt,maxPt) );
00781   h_dzrmshPt.push_back( dbe_->book1D("dzres_vs_pt_Sigma","#sigma(#deltadz vs pT",nintPt,minPt,maxPt) );
00782   h_dxypulletamean.push_back( dbe_->book1D("h_dxypulleta_Mean","mean of dxy pull vs #eta",nintEta,minEta,maxEta) ); 
00783   h_ptpulletamean.push_back( dbe_->book1D("h_ptpulleta_Mean","mean of p_{t} pull vs #eta",nintEta,minEta,maxEta) ); 
00784   h_dzpulletamean.push_back( dbe_->book1D("h_dzpulleta_Mean","mean of dz pull vs #eta",nintEta,minEta,maxEta) ); 
00785   h_phipulletamean.push_back( dbe_->book1D("h_phipulleta_Mean","mean of #phi pull vs #eta",nintEta,minEta,maxEta) ); 
00786   h_thetapulletamean.push_back( dbe_->book1D("h_thetapulleta_Mean","mean of #theta pull vs #eta",nintEta,minEta,maxEta) );
00787   h_dxypulleta.push_back( dbe_->book1D("h_dxypulleta_Sigma","#sigma of dxy pull vs #eta",nintEta,minEta,maxEta) ); 
00788   h_ptpulleta.push_back( dbe_->book1D("h_ptpulleta_Sigma","#sigma of p_{t} pull vs #eta",nintEta,minEta,maxEta) ); 
00789   h_dzpulleta.push_back( dbe_->book1D("h_dzpulleta_Sigma","#sigma of dz pull vs #eta",nintEta,minEta,maxEta) ); 
00790   h_phipulleta.push_back( dbe_->book1D("h_phipulleta_Sigma","#sigma of #phi pull vs #eta",nintEta,minEta,maxEta) ); 
00791   h_thetapulleta.push_back( dbe_->book1D("h_thetapulleta_Sigma","#sigma of #theta pull vs #eta",nintEta,minEta,maxEta) );
00792   h_ptshifteta.push_back( dbe_->book1D("ptres_vs_eta_Mean","<#deltapT/pT>[%] vs #eta",nintEta,minEta,maxEta) ); 
00793   h_ptpullphimean.push_back( dbe_->book1D("h_ptpullphi_Mean","mean of p_{t} pull vs #phi",nintPhi,minPhi,maxPhi) ); 
00794   h_phipullphimean.push_back( dbe_->book1D("h_phipullphi_Mean","mean of #phi pull vs #phi",nintPhi,minPhi,maxPhi) );
00795   h_thetapullphimean.push_back( dbe_->book1D("h_thetapullphi_Mean","mean of #theta pull vs #phi",nintPhi,minPhi,maxPhi) );
00796   h_ptpullphi.push_back( dbe_->book1D("h_ptpullphi_Sigma","#sigma of p_{t} pull vs #phi",nintPhi,minPhi,maxPhi) ); 
00797   h_phipullphi.push_back( dbe_->book1D("h_phipullphi_Sigma","#sigma of #phi pull vs #phi",nintPhi,minPhi,maxPhi) );
00798   h_thetapullphi.push_back( dbe_->book1D("h_thetapullphi_Sigma","#sigma of #theta pull vs #phi",nintPhi,minPhi,maxPhi) );
00799   
00800   if(useLogPt){
00801     BinLogX(h_dzmeanhPt.back()->getTH1F());
00802     BinLogX(h_dzrmshPt.back()->getTH1F());
00803     BinLogX(h_dxymeanhPt.back()->getTH1F());
00804     BinLogX(h_dxyrmshPt.back()->getTH1F());
00805     BinLogX(h_phimeanhPt.back()->getTH1F());
00806     BinLogX(h_phirmshPt.back()->getTH1F());
00807     BinLogX(h_cotThetameanhPt.back()->getTH1F());
00808     BinLogX(h_cotThetarmshPt.back()->getTH1F());
00809     BinLogX(h_ptmeanhPt.back()->getTH1F());
00810     BinLogX(h_ptrmshPt.back()->getTH1F());
00811     BinLogX(h_efficPt.back()->getTH1F());
00812     BinLogX(h_fakeratePt.back()->getTH1F());
00813     BinLogX(h_loopratepT.back()->getTH1F());
00814     BinLogX(h_misidratepT.back()->getTH1F());
00815   }    
00816 }
00817 
00818 void MTVHistoProducerAlgoForTracker::fill_generic_simTrack_histos(int count,
00819                                                                   const TrackingParticle::Vector& momentumTP,
00820                                                                   const TrackingParticle::Point& vertexTP,
00821                                   int bx){
00822   h_ptSIM[count]->Fill(sqrt(momentumTP.perp2()));
00823   h_etaSIM[count]->Fill(momentumTP.eta());
00824   h_vertposSIM[count]->Fill(sqrt(vertexTP.perp2()));
00825   h_bunchxSIM[count]->Fill(bx);
00826 }
00827 
00828 
00829 
00830 // TO BE FIXED USING PLAIN HISTOGRAMS INSTEAD OF RE-IMPLEMENTATION OF HISTOGRAMS (i.d. vectors<int/double>)
00831 void MTVHistoProducerAlgoForTracker::fill_recoAssociated_simTrack_histos(int count,
00832                                                                          const TrackingParticle& tp,
00833                                                                          const TrackingParticle::Vector& momentumTP,
00834                                                                          const TrackingParticle::Point& vertexTP,
00835                                                                          double dxySim, double dzSim, int nSimHits,
00836                                                                          const reco::Track* track,
00837                                                                          int numVertices, double vertz){
00838   bool isMatched = track;
00839 
00840   if((*TpSelectorForEfficiencyVsEta)(tp)){
00841     //effic vs hits
00842     int nSimHitsInBounds = std::min((int)nSimHits,int(maxHit-1));
00843     totSIM_hit[count][nSimHitsInBounds]++;
00844     if(isMatched) {
00845       totASS_hit[count][nSimHitsInBounds]++;
00846       nrecHit_vs_nsimHit_sim2rec[count]->Fill( track->numberOfValidHits(),nSimHits);
00847     }
00848 
00849     //effic vs eta
00850     for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
00851       if (getEta(momentumTP.eta())>etaintervals[count][f]&&
00852           getEta(momentumTP.eta())<etaintervals[count][f+1]) {
00853         totSIMeta[count][f]++;
00854         if (isMatched) {
00855           totASSeta[count][f]++;
00856         }
00857       }
00858 
00859     } // END for (unsigned int f=0; f<etaintervals[w].size()-1; f++){
00860 
00861     //effic vs num pileup vertices
00862     for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
00863       if (numVertices == vertcountintervals[count][f]) {
00864         totSIM_vertcount_entire[count][f]++;
00865         if (isMatched) {
00866           totASS_vertcount_entire[count][f]++;
00867         }
00868       }
00869       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() <= 0.9 && momentumTP.eta() >= -0.9) {
00870         totSIM_vertcount_barrel[count][f]++;
00871         if (isMatched) {
00872           totASS_vertcount_barrel[count][f]++;
00873         }
00874       }
00875       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() > 0.9) {
00876         totSIM_vertcount_fwdpos[count][f]++;
00877         if (isMatched) {
00878           totASS_vertcount_fwdpos[count][f]++;
00879         }
00880       }
00881       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() < -0.9) {
00882         totSIM_vertcount_fwdneg[count][f]++;
00883         if (isMatched) {
00884           totASS_vertcount_fwdneg[count][f]++;
00885         }
00886       }
00887     }
00888 
00889   }
00890 
00891   if((*TpSelectorForEfficiencyVsPhi)(tp)){
00892     for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
00893       if (momentumTP.phi() > phiintervals[count][f]&&
00894           momentumTP.phi() <phiintervals[count][f+1]) {
00895         totSIM_phi[count][f]++;
00896         if (isMatched) {
00897           totASS_phi[count][f]++;
00898         }
00899       }
00900     } // END for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
00901   }
00902         
00903   if((*TpSelectorForEfficiencyVsPt)(tp)){
00904     for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
00905       if (getPt(sqrt(momentumTP.perp2()))>pTintervals[count][f]&&
00906           getPt(sqrt(momentumTP.perp2()))<pTintervals[count][f+1]) {
00907         totSIMpT[count][f]++;
00908         if (isMatched) {
00909           totASSpT[count][f]++;
00910         }
00911       }
00912     } // END for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
00913   }     
00914 
00915   if((*TpSelectorForEfficiencyVsVTXR)(tp)){
00916     for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
00917       if (dxySim>dxyintervals[count][f]&&
00918           dxySim<dxyintervals[count][f+1]) {
00919         totSIM_dxy[count][f]++;
00920         if (isMatched) {
00921           totASS_dxy[count][f]++;
00922         }
00923       }
00924     } // END for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
00925 
00926     for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
00927       if (sqrt(vertexTP.perp2())>vertposintervals[count][f]&&
00928           sqrt(vertexTP.perp2())<vertposintervals[count][f+1]) {
00929         totSIM_vertpos[count][f]++;
00930         if (isMatched) {
00931           totASS_vertpos[count][f]++;
00932         }
00933       }
00934     } // END for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
00935   }
00936 
00937   if((*TpSelectorForEfficiencyVsVTXZ)(tp)){
00938     for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
00939       if (dzSim>dzintervals[count][f]&&
00940           dzSim<dzintervals[count][f+1]) {
00941         totSIM_dz[count][f]++;
00942         if (isMatched) {
00943           totASS_dz[count][f]++;
00944         }
00945       }
00946     } // END for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
00947 
00948   
00949     for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
00950         if (vertexTP.z()>zposintervals[count][f]&&vertexTP.z()<zposintervals[count][f+1]) {
00951                 totSIM_zpos[count][f]++;
00952                 if (isMatched) totASS_zpos[count][f]++;
00953         }
00954         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1]) {
00955                 totSIM_vertz_entire[count][f]++;
00956                 if (isMatched) totASS_vertz_entire[count][f]++;
00957         }
00958         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && fabs(momentumTP.eta())<0.9) {
00959                 totSIM_vertz_barrel[count][f]++;
00960                 if (isMatched) totASS_vertz_barrel[count][f]++;
00961         }
00962         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && momentumTP.eta()>0.9) {
00963                 totSIM_vertz_fwdpos[count][f]++;
00964                 if (isMatched) totASS_vertz_fwdpos[count][f]++;
00965         }
00966         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && momentumTP.eta()<-0.9) {
00967                 totSIM_vertz_fwdneg[count][f]++;
00968                 if (isMatched) totASS_vertz_fwdneg[count][f]++;
00969         }
00970     } // END for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
00971   }
00972 
00973   //Special investigations for PU  
00974   if(((*TpSelectorForEfficiencyVsCon)(tp)) && (!((*TpSelectorForEfficiencyVsEta)(tp)))){
00975 
00976    //efficPU vs eta
00977     for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
00978       if (getEta(momentumTP.eta())>etaintervals[count][f]&&
00979           getEta(momentumTP.eta())<etaintervals[count][f+1]) {
00980         totCONeta[count][f]++;
00981       }
00982     } // END for (unsigned int f=0; f<etaintervals[w].size()-1; f++){
00983 
00984     //efficPU vs num pileup vertices
00985     for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
00986       if (numVertices == vertcountintervals[count][f]) {
00987         totCONvertcount[count][f]++;
00988       }
00989     } // END for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
00990   
00991     for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
00992       if (vertexTP.z()>zposintervals[count][f]&&vertexTP.z()<zposintervals[count][f+1]) {
00993         totCONzpos[count][f]++;
00994       }
00995     } // END for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
00996 
00997   }
00998 
00999 }
01000 
01001 // dE/dx
01002 void MTVHistoProducerAlgoForTracker::fill_dedx_recoTrack_histos(int count, edm::RefToBase<reco::Track>& trackref, const std::vector< edm::ValueMap<reco::DeDxData> >& v_dEdx) {
01003 //void MTVHistoProducerAlgoForTracker::fill_dedx_recoTrack_histos(reco::TrackRef trackref, std::vector< edm::ValueMap<reco::DeDxData> > v_dEdx) {
01004   double dedx;
01005   int nom;
01006   int sat;
01007   edm::ValueMap<reco::DeDxData> dEdxTrack;
01008   for (unsigned int i=0; i<v_dEdx.size(); i++) {
01009     dEdxTrack = v_dEdx.at(i);
01010     dedx = dEdxTrack[trackref].dEdx(); 
01011     nom  = dEdxTrack[trackref].numberOfMeasurements();
01012     sat  = dEdxTrack[trackref].numberOfSaturatedMeasurements();
01013     if (i==0) {
01014       h_dedx_estim1[count]->Fill(dedx);
01015       h_dedx_nom1[count]->Fill(nom);
01016       h_dedx_sat1[count]->Fill(sat);
01017     } else if (i==1) {
01018       h_dedx_estim2[count]->Fill(dedx);
01019       h_dedx_nom2[count]->Fill(nom);
01020       h_dedx_sat2[count]->Fill(sat);
01021     }
01022   }
01023 }
01024 
01025 
01026 // TO BE FIXED USING PLAIN HISTOGRAMS INSTEAD OF RE-IMPLEMENTATION OF HISTOGRAMS (i.d. vectors<int/double>)
01027 void MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(int count,
01028                                                                    const reco::Track& track,
01029                                                                    const math::XYZPoint& bsPosition,
01030                                                                    bool isMatched,
01031                                                                    bool isSigMatched,
01032                                                                    bool isChargeMatched,
01033                                    int numAssocRecoTracks,
01034                                    int numVertices,
01035                                    int tpbunchcrossing, int nSimHits,
01036                                    double sharedFraction){
01037 
01038   //Fill track algo histogram
01039 
01040   if (track.algo()>=4 && track.algo()<=14) totREC_algo[count][track.algo()-4]++;  
01041   int sharedHits = sharedFraction *  track.numberOfValidHits();
01042 
01043   //Compute fake rate vs eta
01044   for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
01045     if (getEta(track.momentum().eta())>etaintervals[count][f]&&
01046         getEta(track.momentum().eta())<etaintervals[count][f+1]) {
01047       totRECeta[count][f]++;
01048       if (isMatched) {
01049         totASS2eta[count][f]++;
01050         if (!isChargeMatched) totmisideta[count][f]++;
01051         if (numAssocRecoTracks>1) totloopeta[count][f]++;
01052         if (tpbunchcrossing==0) totASS2_itpu_eta_entire[count][f]++;
01053         if (tpbunchcrossing!=0) totASS2_ootpu_eta_entire[count][f]++;
01054         nrecHit_vs_nsimHit_rec2sim[count]->Fill( track.numberOfValidHits(),nSimHits);
01055         h_assocFraction[count]->Fill( sharedFraction);
01056         h_assocSharedHit[count]->Fill( sharedHits);
01057       }
01058       if (isSigMatched) {
01059         totASS2etaSig[count][f]++;
01060         if (tpbunchcrossing==0) totASS2_itpu_eta_entire_signal[count][f]++;
01061       }
01062     }
01063   } // End for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
01064 
01065   for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
01066     if (track.momentum().phi()>phiintervals[count][f]&&
01067         track.momentum().phi()<phiintervals[count][f+1]) {
01068       totREC_phi[count][f]++; 
01069       if (isMatched) {
01070         totASS2_phi[count][f]++;
01071         if (!isChargeMatched) totmisid_phi[count][f]++;
01072         if (numAssocRecoTracks>1) totloop_phi[count][f]++;
01073       }         
01074     }
01075   } // End for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
01076 
01077         
01078   for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
01079     if (getPt(sqrt(track.momentum().perp2()))>pTintervals[count][f]&&
01080         getPt(sqrt(track.momentum().perp2()))<pTintervals[count][f+1]) {
01081       totRECpT[count][f]++; 
01082       if (isMatched) {
01083         totASS2pT[count][f]++;
01084         if (!isChargeMatched) totmisidpT[count][f]++;
01085         if (numAssocRecoTracks>1) totlooppT[count][f]++;
01086       }       
01087     }
01088   } // End for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
01089   
01090   for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
01091     if (track.dxy(bsPosition)>dxyintervals[count][f]&&
01092         track.dxy(bsPosition)<dxyintervals[count][f+1]) {
01093       totREC_dxy[count][f]++; 
01094       if (isMatched) {
01095         totASS2_dxy[count][f]++;
01096         if (!isChargeMatched) totmisid_dxy[count][f]++;
01097         if (numAssocRecoTracks>1) totloop_dxy[count][f]++;
01098       }       
01099     }
01100   } // End for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
01101   
01102   for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
01103     if (track.dz(bsPosition)>dzintervals[count][f]&&
01104         track.dz(bsPosition)<dzintervals[count][f+1]) {
01105       totREC_dz[count][f]++; 
01106       if (isMatched) {
01107         totASS2_dz[count][f]++;
01108         if (!isChargeMatched) totmisid_dz[count][f]++;
01109         if (numAssocRecoTracks>1) totloop_dz[count][f]++;
01110       }       
01111     }
01112   } // End for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
01113 
01114   int tmp = std::min((int)track.found(),int(maxHit-1));
01115   totREC_hit[count][tmp]++;
01116   if (isMatched) {
01117     totASS2_hit[count][tmp]++;
01118     if (!isChargeMatched) totmisid_hit[count][tmp]++;
01119     if (numAssocRecoTracks>1) totloop_hit[count][tmp]++;
01120   }
01121 
01122   for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
01123     if (numVertices ==  vertcountintervals[count][f]) {
01124       totREC_vertcount_entire[count][f]++;
01125       totREC_ootpu_entire[count][f]++;
01126       if (isMatched) {
01127         totASS2_vertcount_entire[count][f]++;
01128         if (tpbunchcrossing==0) totASS2_itpu_vertcount_entire[count][f]++;
01129         if (tpbunchcrossing!=0) totASS2_ootpu_entire[count][f]++;
01130       }
01131       if (isSigMatched) {
01132         totASS2_vertcount_entire_signal[count][f]++;
01133         if (tpbunchcrossing==0) totASS2_itpu_vertcount_entire_signal[count][f]++;
01134       }
01135     }
01136     if (numVertices ==  vertcountintervals[count][f] && track.eta() <= 0.9 && track.eta() >= -0.9) {
01137       totREC_vertcount_barrel[count][f]++;
01138       totREC_ootpu_barrel[count][f]++;
01139       if (isMatched) {
01140         totASS2_vertcount_barrel[count][f]++;
01141         if (isMatched && tpbunchcrossing!=0) totASS2_ootpu_barrel[count][f]++;
01142       }
01143     }
01144     if (numVertices ==  vertcountintervals[count][f] && track.eta() > 0.9) {
01145       totREC_vertcount_fwdpos[count][f]++;
01146       totREC_ootpu_fwdpos[count][f]++;
01147       if (isMatched) {
01148         totASS2_vertcount_fwdpos[count][f]++;
01149         if (isMatched && tpbunchcrossing!=0) totASS2_ootpu_fwdpos[count][f]++;
01150       }
01151     }
01152     if (numVertices ==  vertcountintervals[count][f] && track.eta() < -0.9) {
01153       totREC_vertcount_fwdneg[count][f]++;
01154       totREC_ootpu_fwdneg[count][f]++;
01155       if (isMatched) {
01156         totASS2_vertcount_fwdneg[count][f]++;
01157         if (isMatched && tpbunchcrossing!=0) totASS2_ootpu_fwdneg[count][f]++;
01158       }
01159     }
01160 
01161   }
01162 
01163 }
01164 
01165 
01166 void MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(int count,
01167                                                                          const reco::Track& track){
01168     //nchi2 and hits global distributions
01169     h_nchi2[count]->Fill(track.normalizedChi2());
01170     h_nchi2_prob[count]->Fill(TMath::Prob(track.chi2(),(int)track.ndof()));
01171     h_hits[count]->Fill(track.numberOfValidHits());
01172     h_losthits[count]->Fill(track.numberOfLostHits());
01173     chi2_vs_nhits[count]->Fill(track.numberOfValidHits(),track.normalizedChi2());
01174     h_charge[count]->Fill( track.charge() );
01175     
01176     //chi2 and #hit vs eta: fill 2D histos
01177     chi2_vs_eta[count]->Fill(getEta(track.eta()),track.normalizedChi2());
01178     nhits_vs_eta[count]->Fill(getEta(track.eta()),track.numberOfValidHits());
01179     nPXBhits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidPixelBarrelHits());
01180     nPXFhits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidPixelEndcapHits());
01181     nTIBhits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidStripTIBHits());
01182     nTIDhits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidStripTIDHits());
01183     nTOBhits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidStripTOBHits());
01184     nTEChits_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().numberOfValidStripTECHits());
01185     nLayersWithMeas_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().trackerLayersWithMeasurement());
01186     nPXLlayersWithMeas_vs_eta[count]->Fill(getEta(track.eta()),track.hitPattern().pixelLayersWithMeasurement());
01187     int LayersAll = track.hitPattern().stripLayersWithMeasurement();
01188     int Layers2D = track.hitPattern().numberOfValidStripLayersWithMonoAndStereo(); 
01189     int Layers1D = LayersAll - Layers2D;        
01190     nSTRIPlayersWithMeas_vs_eta[count]->Fill(getEta(track.eta()),LayersAll);
01191     nSTRIPlayersWith1dMeas_vs_eta[count]->Fill(getEta(track.eta()),Layers1D);
01192     nSTRIPlayersWith2dMeas_vs_eta[count]->Fill(getEta(track.eta()),Layers2D);
01193         
01194     nlosthits_vs_eta[count]->Fill(getEta(track.eta()),track.numberOfLostHits());
01195 }
01196 
01197 
01198 void MTVHistoProducerAlgoForTracker::fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks){
01199 
01200         h_tracks[count]->Fill(assTracks);
01201         h_fakes[count]->Fill(numRecoTracks-assTracks);
01202         nrec_vs_nsim[count]->Fill(numRecoTracks,numSimTracks);
01203 
01204 }
01205 
01206 
01207 
01208 void MTVHistoProducerAlgoForTracker::fill_ResoAndPull_recoTrack_histos(int count,
01209                                                                        const TrackingParticle::Vector& momentumTP,
01210                                                                        const TrackingParticle::Point& vertexTP,
01211                                                                        int chargeTP,
01212                                                                        const reco::Track& track,
01213                                                                        const math::XYZPoint& bsPosition){
01214 
01215   // evaluation of TP parameters
01216   double qoverpSim = chargeTP/sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
01217   double lambdaSim = M_PI/2-momentumTP.theta();
01218   double phiSim    = momentumTP.phi();
01219   double dxySim    = (-vertexTP.x()*sin(momentumTP.phi())+vertexTP.y()*cos(momentumTP.phi()));
01220   double dzSim     = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/sqrt(momentumTP.perp2()) 
01221     * momentumTP.z()/sqrt(momentumTP.perp2());
01222 
01223           
01224   //  reco::Track::ParameterVector rParameters = track.parameters(); // UNUSED
01225   
01226   double qoverpRec(0);
01227   double qoverpErrorRec(0); 
01228   double ptRec(0);
01229   double ptErrorRec(0);
01230   double lambdaRec(0); 
01231   double lambdaErrorRec(0);
01232   double phiRec(0);
01233   double phiErrorRec(0);
01234 
01235   /* TO BE FIXED LATER  -----------
01236   //loop to decide whether to take gsfTrack (utilisation of mode-function) or common track
01237   const GsfTrack* gsfTrack(0);
01238   if(useGsf){
01239     gsfTrack = dynamic_cast<const GsfTrack*>(&(*track));
01240     if (gsfTrack==0) edm::LogInfo("TrackValidator") << "Trying to access mode for a non-GsfTrack";
01241   }
01242   
01243   if (gsfTrack) {
01244     // get values from mode
01245     getRecoMomentum(*gsfTrack, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, 
01246                     lambdaRec,lambdaErrorRec, phiRec, phiErrorRec); 
01247   }
01248          
01249   else {
01250     // get values from track (without mode) 
01251     getRecoMomentum(*track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, 
01252                     lambdaRec,lambdaErrorRec, phiRec, phiErrorRec); 
01253   }
01254   */
01255   getRecoMomentum(track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, 
01256                   lambdaRec,lambdaErrorRec, phiRec, phiErrorRec); 
01257   // -------------
01258 
01259   double ptError = ptErrorRec;  
01260   double ptres=ptRec-sqrt(momentumTP.perp2()); 
01261   double etares=track.eta()-momentumTP.Eta();
01262 
01263 
01264   double dxyRec    = track.dxy(bsPosition);
01265   double dzRec     = track.dz(bsPosition);
01266 
01267   // eta residue; pt, k, theta, phi, dxy, dz pulls
01268   double qoverpPull=(qoverpRec-qoverpSim)/qoverpErrorRec;
01269   double thetaPull=(lambdaRec-lambdaSim)/lambdaErrorRec;
01270   double phiPull=(phiRec-phiSim)/phiErrorRec;
01271   double dxyPull=(dxyRec-dxySim)/track.dxyError();
01272   double dzPull=(dzRec-dzSim)/track.dzError();
01273 
01274   double contrib_Qoverp = ((qoverpRec-qoverpSim)/qoverpErrorRec)*
01275     ((qoverpRec-qoverpSim)/qoverpErrorRec)/5;
01276   double contrib_dxy = ((dxyRec-dxySim)/track.dxyError())*((dxyRec-dxySim)/track.dxyError())/5;
01277   double contrib_dz = ((dzRec-dzSim)/track.dzError())*((dzRec-dzSim)/track.dzError())/5;
01278   double contrib_theta = ((lambdaRec-lambdaSim)/lambdaErrorRec)*
01279     ((lambdaRec-lambdaSim)/lambdaErrorRec)/5;
01280   double contrib_phi = ((phiRec-phiSim)/phiErrorRec)*
01281     ((phiRec-phiSim)/phiErrorRec)/5;
01282 
01283   LogTrace("TrackValidatorTEST") 
01284     //<< "assocChi2=" << tp.begin()->second << "\n"
01285     << "" <<  "\n"
01286     << "ptREC=" << ptRec << "\n" << "etaREC=" << track.eta() << "\n" << "qoverpREC=" << qoverpRec << "\n"
01287     << "dxyREC=" << dxyRec << "\n" << "dzREC=" << dzRec << "\n"
01288     << "thetaREC=" << track.theta() << "\n" << "phiREC=" << phiRec << "\n"
01289     << "" <<  "\n"
01290     << "qoverpError()=" << qoverpErrorRec << "\n" << "dxyError()=" << track.dxyError() << "\n"<< "dzError()=" 
01291     << track.dzError() << "\n"
01292     << "thetaError()=" << lambdaErrorRec << "\n" << "phiError()=" << phiErrorRec << "\n"
01293     << "" <<  "\n"
01294     << "ptSIM=" << sqrt(momentumTP.perp2()) << "\n"<< "etaSIM=" << momentumTP.Eta() << "\n"<< "qoverpSIM=" << qoverpSim << "\n"
01295     << "dxySIM=" << dxySim << "\n"<< "dzSIM=" << dzSim << "\n" << "thetaSIM=" << M_PI/2-lambdaSim << "\n" 
01296     << "phiSIM=" << phiSim << "\n"
01297     << "" << "\n"
01298     << "contrib_Qoverp=" << contrib_Qoverp << "\n"<< "contrib_dxy=" << contrib_dxy << "\n"<< "contrib_dz=" << contrib_dz << "\n"
01299     << "contrib_theta=" << contrib_theta << "\n"<< "contrib_phi=" << contrib_phi << "\n"
01300     << "" << "\n"
01301     <<"chi2PULL="<<contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi<<"\n";
01302 
01303   h_pullQoverp[count]->Fill(qoverpPull);
01304   h_pullTheta[count]->Fill(thetaPull);
01305   h_pullPhi[count]->Fill(phiPull);
01306   h_pullDxy[count]->Fill(dxyPull);
01307   h_pullDz[count]->Fill(dzPull);
01308 
01309 
01310   h_pt[count]->Fill(ptres/ptError);
01311   h_eta[count]->Fill(etares);
01312   etares_vs_eta[count]->Fill(getEta(track.eta()),etares);
01313   
01314 
01315         
01316   //resolution of track params: fill 2D histos
01317   dxyres_vs_eta[count]->Fill(getEta(track.eta()),dxyRec-dxySim);
01318   ptres_vs_eta[count]->Fill(getEta(track.eta()),(ptRec-sqrt(momentumTP.perp2()))/ptRec);
01319   dzres_vs_eta[count]->Fill(getEta(track.eta()),dzRec-dzSim);
01320   phires_vs_eta[count]->Fill(getEta(track.eta()),phiRec-phiSim);
01321   cotThetares_vs_eta[count]->Fill(getEta(track.eta()),1/tan(M_PI*0.5-lambdaRec)-1/tan(M_PI*0.5-lambdaSim));         
01322   
01323   //same as before but vs pT
01324   dxyres_vs_pt[count]->Fill(getPt(ptRec),dxyRec-dxySim);
01325   ptres_vs_pt[count]->Fill(getPt(ptRec),(ptRec-sqrt(momentumTP.perp2()))/ptRec);
01326   dzres_vs_pt[count]->Fill(getPt(ptRec),dzRec-dzSim);
01327   phires_vs_pt[count]->Fill(getPt(ptRec),phiRec-phiSim);
01328   cotThetares_vs_pt[count]->Fill(getPt(ptRec),1/tan(M_PI*0.5-lambdaRec)-1/tan(M_PI*0.5-lambdaSim));      
01329         
01330   //pulls of track params vs eta: fill 2D histos
01331   dxypull_vs_eta[count]->Fill(getEta(track.eta()),dxyPull);
01332   ptpull_vs_eta[count]->Fill(getEta(track.eta()),ptres/ptError);
01333   dzpull_vs_eta[count]->Fill(getEta(track.eta()),dzPull);
01334   phipull_vs_eta[count]->Fill(getEta(track.eta()),phiPull);
01335   thetapull_vs_eta[count]->Fill(getEta(track.eta()),thetaPull);
01336         
01337   //plots vs phi
01338   nhits_vs_phi[count]->Fill(phiRec,track.numberOfValidHits());
01339   chi2_vs_phi[count]->Fill(phiRec,track.normalizedChi2());
01340   ptmean_vs_eta_phi[count]->Fill(phiRec,getEta(track.eta()),ptRec);
01341   phimean_vs_eta_phi[count]->Fill(phiRec,getEta(track.eta()),phiRec);
01342   ptres_vs_phi[count]->Fill(phiRec,(ptRec-sqrt(momentumTP.perp2()))/ptRec);
01343   phires_vs_phi[count]->Fill(phiRec,phiRec-phiSim); 
01344   ptpull_vs_phi[count]->Fill(phiRec,ptres/ptError);
01345   phipull_vs_phi[count]->Fill(phiRec,phiPull); 
01346   thetapull_vs_phi[count]->Fill(phiRec,thetaPull); 
01347 
01348 
01349 }
01350 
01351 
01352 
01353 void 
01354 MTVHistoProducerAlgoForTracker::getRecoMomentum (const reco::Track& track, double& pt, double& ptError,
01355                                                  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
01356                                                  double& phi, double& phiError ) const {
01357   pt = track.pt();
01358   ptError = track.ptError();
01359   qoverp = track.qoverp();
01360   qoverpError = track.qoverpError();
01361   lambda = track.lambda();
01362   lambdaError = track.lambdaError(); 
01363   phi = track.phi(); 
01364   phiError = track.phiError();
01365   //   cout <<"test1" << endl; 
01366   
01367 
01368 
01369 }
01370 
01371 void 
01372 MTVHistoProducerAlgoForTracker::getRecoMomentum (const reco::GsfTrack& gsfTrack, double& pt, double& ptError,
01373                                                  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
01374                                                  double& phi, double& phiError  ) const {
01375 
01376   pt = gsfTrack.ptMode();
01377   ptError = gsfTrack.ptModeError();
01378   qoverp = gsfTrack.qoverpMode();
01379   qoverpError = gsfTrack.qoverpModeError();
01380   lambda = gsfTrack.lambdaMode();
01381   lambdaError = gsfTrack.lambdaModeError(); 
01382   phi = gsfTrack.phiMode(); 
01383   phiError = gsfTrack.phiModeError();
01384   //   cout <<"test2" << endl;
01385 
01386 }
01387 
01388 double 
01389 MTVHistoProducerAlgoForTracker::getEta(double eta) {
01390   if (useFabsEta) return fabs(eta);
01391   else return eta;
01392 }
01393   
01394 double 
01395 MTVHistoProducerAlgoForTracker::getPt(double pt) {
01396   if (useInvPt && pt!=0) return 1/pt;
01397   else return pt;
01398 }
01399 
01400 
01401 void MTVHistoProducerAlgoForTracker::finalHistoFits(int counter){
01402   //resolution of track params: get sigma from 2D histos
01403   FitSlicesYTool fsyt_dxy(dxyres_vs_eta[counter]);
01404   fsyt_dxy.getFittedSigmaWithError(h_dxyrmsh[counter]);
01405   fsyt_dxy.getFittedMeanWithError(h_dxymeanh[counter]);
01406   FitSlicesYTool fsyt_dxyPt(dxyres_vs_pt[counter]);
01407   fsyt_dxyPt.getFittedSigmaWithError(h_dxyrmshPt[counter]);
01408   fsyt_dxyPt.getFittedMeanWithError(h_dxymeanhPt[counter]);
01409   FitSlicesYTool fsyt_pt(ptres_vs_eta[counter]);
01410   fsyt_pt.getFittedSigmaWithError(h_ptrmsh[counter]);
01411   fsyt_pt.getFittedMeanWithError(h_ptshifteta[counter]);      
01412   FitSlicesYTool fsyt_ptPt(ptres_vs_pt[counter]);
01413   fsyt_ptPt.getFittedSigmaWithError(h_ptrmshPt[counter]);
01414   fsyt_ptPt.getFittedMeanWithError(h_ptmeanhPt[counter]);
01415   FitSlicesYTool fsyt_ptPhi(ptres_vs_phi[counter]); 
01416   fsyt_ptPhi.getFittedSigmaWithError(h_ptrmshPhi[counter]);
01417   fsyt_ptPhi.getFittedMeanWithError(h_ptmeanhPhi[counter]);
01418   FitSlicesYTool fsyt_dz(dzres_vs_eta[counter]);
01419   fsyt_dz.getFittedSigmaWithError(h_dzrmsh[counter]);
01420   fsyt_dz.getFittedMeanWithError(h_dzmeanh[counter]);
01421   FitSlicesYTool fsyt_dzPt(dzres_vs_pt[counter]);
01422   fsyt_dzPt.getFittedSigmaWithError(h_dzrmshPt[counter]);
01423   fsyt_dzPt.getFittedMeanWithError(h_dzmeanhPt[counter]);
01424   FitSlicesYTool fsyt_phi(phires_vs_eta[counter]);
01425   fsyt_phi.getFittedSigmaWithError(h_phirmsh[counter]);
01426   fsyt_phi.getFittedMeanWithError(h_phimeanh[counter]);
01427   FitSlicesYTool fsyt_phiPt(phires_vs_pt[counter]);
01428   fsyt_phiPt.getFittedSigmaWithError(h_phirmshPt[counter]);
01429   fsyt_phiPt.getFittedMeanWithError(h_phimeanhPt[counter]);
01430   FitSlicesYTool fsyt_phiPhi(phires_vs_phi[counter]); 
01431   fsyt_phiPhi.getFittedSigmaWithError(h_phirmshPhi[counter]); 
01432   fsyt_phiPhi.getFittedMeanWithError(h_phimeanhPhi[counter]); 
01433   FitSlicesYTool fsyt_cotTheta(cotThetares_vs_eta[counter]);
01434   fsyt_cotTheta.getFittedSigmaWithError(h_cotThetarmsh[counter]);
01435   fsyt_cotTheta.getFittedMeanWithError(h_cotThetameanh[counter]);
01436   FitSlicesYTool fsyt_cotThetaPt(cotThetares_vs_pt[counter]);
01437   fsyt_cotThetaPt.getFittedSigmaWithError(h_cotThetarmshPt[counter]);
01438   fsyt_cotThetaPt.getFittedMeanWithError(h_cotThetameanhPt[counter]);
01439 
01440   //pulls of track params vs eta: get sigma from 2D histos
01441   FitSlicesYTool fsyt_dxyp(dxypull_vs_eta[counter]);
01442   fsyt_dxyp.getFittedSigmaWithError(h_dxypulleta[counter]);
01443   fsyt_dxyp.getFittedMeanWithError(h_dxypulletamean[counter]);
01444   FitSlicesYTool fsyt_ptp(ptpull_vs_eta[counter]);
01445   fsyt_ptp.getFittedSigmaWithError(h_ptpulleta[counter]);
01446   fsyt_ptp.getFittedMeanWithError(h_ptpulletamean[counter]);
01447   FitSlicesYTool fsyt_dzp(dzpull_vs_eta[counter]);
01448   fsyt_dzp.getFittedSigmaWithError(h_dzpulleta[counter]);
01449   fsyt_dzp.getFittedMeanWithError(h_dzpulletamean[counter]);
01450   FitSlicesYTool fsyt_phip(phipull_vs_eta[counter]);
01451   fsyt_phip.getFittedSigmaWithError(h_phipulleta[counter]);
01452   fsyt_phip.getFittedMeanWithError(h_phipulletamean[counter]);
01453   FitSlicesYTool fsyt_thetap(thetapull_vs_eta[counter]);
01454   fsyt_thetap.getFittedSigmaWithError(h_thetapulleta[counter]);
01455   fsyt_thetap.getFittedMeanWithError(h_thetapulletamean[counter]);
01456   //vs phi
01457   FitSlicesYTool fsyt_ptpPhi(ptpull_vs_phi[counter]);
01458   fsyt_ptpPhi.getFittedSigmaWithError(h_ptpullphi[counter]);
01459   fsyt_ptpPhi.getFittedMeanWithError(h_ptpullphimean[counter]);
01460   FitSlicesYTool fsyt_phipPhi(phipull_vs_phi[counter]);
01461   fsyt_phipPhi.getFittedSigmaWithError(h_phipullphi[counter]);
01462   fsyt_phipPhi.getFittedMeanWithError(h_phipullphimean[counter]);
01463   FitSlicesYTool fsyt_thetapPhi(thetapull_vs_phi[counter]);
01464   fsyt_thetapPhi.getFittedSigmaWithError(h_thetapullphi[counter]);
01465   fsyt_thetapPhi.getFittedMeanWithError(h_thetapullphimean[counter]);
01466   
01467   //effic&fake;
01468   for (unsigned int ite = 0;ite<totASSeta[counter].size();ite++) totFOMT_eta[counter][ite]=totASS2eta[counter][ite]-totASS2etaSig[counter][ite];
01469   for (unsigned int ite = 0;ite<totASS2_vertcount_entire[counter].size();ite++)  
01470     totFOMT_vertcount[counter][ite]=totASS2_vertcount_entire[counter][ite]-totASS2_vertcount_entire_signal[counter][ite];
01471   for (unsigned int ite = 0;ite<totASS2_itpu_eta_entire[counter].size();ite++) totASS2_itpu_eta_entire[counter][ite]-=totASS2_itpu_eta_entire_signal[counter][ite];
01472   for (unsigned int ite = 0;ite<totASS2_itpu_vertcount_entire[counter].size();ite++) totASS2_itpu_vertcount_entire[counter][ite]-=totASS2_itpu_vertcount_entire_signal[counter][ite];
01473 
01474   fillPlotFromVectors(h_effic[counter],totASSeta[counter],totSIMeta[counter],"effic");
01475   fillPlotFromVectors(h_fakerate[counter],totASS2eta[counter],totRECeta[counter],"fakerate");
01476   fillPlotFromVectors(h_looprate[counter],totloopeta[counter],totRECeta[counter],"effic");
01477   fillPlotFromVectors(h_misidrate[counter],totmisideta[counter],totRECeta[counter],"effic");
01478   fillPlotFromVectors(h_efficPt[counter],totASSpT[counter],totSIMpT[counter],"effic");
01479   fillPlotFromVectors(h_fakeratePt[counter],totASS2pT[counter],totRECpT[counter],"fakerate");
01480   fillPlotFromVectors(h_loopratepT[counter],totlooppT[counter],totRECpT[counter],"effic");
01481   fillPlotFromVectors(h_misidratepT[counter],totmisidpT[counter],totRECpT[counter],"effic");
01482   fillPlotFromVectors(h_effic_vs_hit[counter],totASS_hit[counter],totSIM_hit[counter],"effic");
01483   fillPlotFromVectors(h_fake_vs_hit[counter],totASS2_hit[counter],totREC_hit[counter],"fakerate");
01484   fillPlotFromVectors(h_loopratehit[counter],totloop_hit[counter],totREC_hit[counter],"effic");
01485   fillPlotFromVectors(h_misidratehit[counter],totmisid_hit[counter],totREC_hit[counter],"effic");
01486   fillPlotFromVectors(h_effic_vs_phi[counter],totASS_phi[counter],totSIM_phi[counter],"effic");
01487   fillPlotFromVectors(h_fake_vs_phi[counter],totASS2_phi[counter],totREC_phi[counter],"fakerate");
01488   fillPlotFromVectors(h_loopratephi[counter],totloop_phi[counter],totREC_phi[counter],"effic");
01489   fillPlotFromVectors(h_misidratephi[counter],totmisid_phi[counter],totREC_phi[counter],"effic");
01490   fillPlotFromVectors(h_effic_vs_dxy[counter],totASS_dxy[counter],totSIM_dxy[counter],"effic");
01491   fillPlotFromVectors(h_fake_vs_dxy[counter],totASS2_dxy[counter],totREC_dxy[counter],"fakerate");
01492   fillPlotFromVectors(h_loopratedxy[counter],totloop_dxy[counter],totREC_dxy[counter],"effic");
01493   fillPlotFromVectors(h_misidratedxy[counter],totmisid_dxy[counter],totREC_dxy[counter],"effic");
01494   fillPlotFromVectors(h_effic_vs_dz[counter],totASS_dz[counter],totSIM_dz[counter],"effic");
01495   fillPlotFromVectors(h_fake_vs_dz[counter],totASS2_dz[counter],totREC_dz[counter],"fakerate");
01496   fillPlotFromVectors(h_loopratedz[counter],totloop_dz[counter],totREC_dz[counter],"effic");
01497   fillPlotFromVectors(h_misidratedz[counter],totmisid_dz[counter],totREC_dz[counter],"effic");
01498   fillPlotFromVectors(h_effic_vs_vertpos[counter],totASS_vertpos[counter],totSIM_vertpos[counter],"effic");
01499   fillPlotFromVectors(h_effic_vs_zpos[counter],totASS_zpos[counter],totSIM_zpos[counter],"effic");
01500   fillPlotFromVectors(h_effic_vertcount_entire[counter],totASS_vertcount_entire[counter],totSIM_vertcount_entire[counter],"effic");
01501   fillPlotFromVectors(h_effic_vertcount_barrel[counter],totASS_vertcount_barrel[counter],totSIM_vertcount_barrel[counter],"effic");
01502   fillPlotFromVectors(h_effic_vertcount_fwdpos[counter],totASS_vertcount_fwdpos[counter],totSIM_vertcount_fwdpos[counter],"effic");
01503   fillPlotFromVectors(h_effic_vertcount_fwdneg[counter],totASS_vertcount_fwdneg[counter],totSIM_vertcount_fwdneg[counter],"effic");
01504   fillPlotFromVectors(h_fakerate_vertcount_entire[counter],totASS2_vertcount_entire[counter],totREC_vertcount_entire[counter],"fakerate");
01505   fillPlotFromVectors(h_fakerate_vertcount_barrel[counter],totASS2_vertcount_barrel[counter],totREC_vertcount_barrel[counter],"fakerate");
01506   fillPlotFromVectors(h_fakerate_vertcount_fwdpos[counter],totASS2_vertcount_fwdpos[counter],totREC_vertcount_fwdpos[counter],"fakerate");
01507   fillPlotFromVectors(h_fakerate_vertcount_fwdneg[counter],totASS2_vertcount_fwdneg[counter],totREC_vertcount_fwdneg[counter],"fakerate");
01508   fillPlotFromVectors(h_effic_vertz_entire[counter],totASS_vertz_entire[counter],totSIM_vertz_entire[counter],"effic");
01509   fillPlotFromVectors(h_effic_vertz_barrel[counter],totASS_vertz_barrel[counter],totSIM_vertz_barrel[counter],"effic");
01510   fillPlotFromVectors(h_effic_vertz_fwdpos[counter],totASS_vertz_fwdpos[counter],totSIM_vertz_fwdpos[counter],"effic");
01511   fillPlotFromVectors(h_effic_vertz_fwdneg[counter],totASS_vertz_fwdneg[counter],totSIM_vertz_fwdneg[counter],"effic");
01512   fillPlotFromVectors(h_fakerate_ootpu_entire[counter],totASS2_ootpu_entire[counter],totREC_ootpu_entire[counter],"effic");
01513   fillPlotFromVectors(h_fakerate_ootpu_barrel[counter],totASS2_ootpu_barrel[counter],totREC_ootpu_barrel[counter],"effic");
01514   fillPlotFromVectors(h_fakerate_ootpu_fwdpos[counter],totASS2_ootpu_fwdpos[counter],totREC_ootpu_fwdpos[counter],"effic");
01515   fillPlotFromVectors(h_fakerate_ootpu_fwdneg[counter],totASS2_ootpu_fwdneg[counter],totREC_ootpu_fwdneg[counter],"effic");
01516 
01517   fillPlotFromVectors(h_fomt_eta[counter],totFOMT_eta[counter],totASS2etaSig[counter],"pileup");
01518   fillPlotFromVectors(h_fomt_vertcount[counter],totFOMT_vertcount[counter],totASS2_vertcount_entire_signal[counter],"pileup");
01519   fillPlotFromVectors(h_fomt_sig_eta[counter],totASS2etaSig[counter],totRECeta[counter],"fakerate");
01520   fillPlotFromVectors(h_fomt_sig_vertcount[counter],totASS2_vertcount_entire_signal[counter],totREC_vertcount_entire[counter],"fakerate");
01521   fillPlotFromVectors(h_fomt_itpu_eta[counter],totASS2_itpu_eta_entire[counter],totRECeta[counter],"effic");
01522   fillPlotFromVectors(h_fomt_itpu_vertcount[counter],totASS2_itpu_vertcount_entire[counter],totREC_vertcount_entire[counter],"effic");
01523   fillPlotFromVectors(h_fomt_ootpu_eta[counter],totASS2_ootpu_eta_entire[counter],totRECeta[counter],"effic");
01524   fillPlotFromVectors(h_fomt_ootpu_vertcount[counter],totASS2_ootpu_entire[counter],totREC_ootpu_entire[counter],"effic");
01525 
01526   fillPlotFromVectors(h_effic_PU_eta[counter],totASSeta[counter],totCONeta[counter],"pileup");
01527   fillPlotFromVectors(h_effic_PU_vertcount[counter],totASS_vertcount_entire[counter],totCONvertcount[counter],"pileup");
01528   fillPlotFromVectors(h_effic_PU_zpos[counter],totASS_zpos[counter],totCONzpos[counter],"pileup");
01529 
01530 }
01531 
01532 void MTVHistoProducerAlgoForTracker::fillProfileHistosFromVectors(int counter){
01533   //chi2 and #hit vs eta: get mean from 2D histos
01534   doProfileX(chi2_vs_eta[counter],h_chi2meanh[counter]);
01535   doProfileX(nhits_vs_eta[counter],h_hits_eta[counter]);
01536   doProfileX(nPXBhits_vs_eta[counter],h_PXBhits_eta[counter]);
01537   doProfileX(nPXFhits_vs_eta[counter],h_PXFhits_eta[counter]);
01538   doProfileX(nTIBhits_vs_eta[counter],h_TIBhits_eta[counter]);
01539   doProfileX(nTIDhits_vs_eta[counter],h_TIDhits_eta[counter]);
01540   doProfileX(nTOBhits_vs_eta[counter],h_TOBhits_eta[counter]);
01541   doProfileX(nTEChits_vs_eta[counter],h_TEChits_eta[counter]);
01542 
01543   doProfileX(nLayersWithMeas_vs_eta[counter],h_LayersWithMeas_eta[counter]);
01544   doProfileX(nPXLlayersWithMeas_vs_eta[counter],h_PXLlayersWithMeas_eta[counter]);    
01545   doProfileX(nSTRIPlayersWithMeas_vs_eta[counter],h_STRIPlayersWithMeas_eta[counter]);    
01546   doProfileX(nSTRIPlayersWith1dMeas_vs_eta[counter],h_STRIPlayersWith1dMeas_eta[counter]);
01547   doProfileX(nSTRIPlayersWith2dMeas_vs_eta[counter],h_STRIPlayersWith2dMeas_eta[counter]);
01548 
01549 
01550 
01551   doProfileX(nlosthits_vs_eta[counter],h_losthits_eta[counter]);
01552   //vs phi
01553   doProfileX(chi2_vs_nhits[counter],h_chi2meanhitsh[counter]); 
01554   //      doProfileX(ptres_vs_eta[counter],h_ptresmean_vs_eta[counter]);
01555   //      doProfileX(phires_vs_eta[counter],h_phiresmean_vs_eta[counter]);
01556   doProfileX(chi2_vs_phi[counter],h_chi2mean_vs_phi[counter]);
01557   doProfileX(nhits_vs_phi[counter],h_hits_phi[counter]);
01558   //       doProfileX(ptres_vs_phi[counter],h_ptresmean_vs_phi[counter]);
01559   //       doProfileX(phires_vs_phi[counter],h_phiresmean_vs_phi[counter]);
01560 }
01561 
01562 void MTVHistoProducerAlgoForTracker::fillHistosFromVectors(int counter){
01563   fillPlotFromVector(h_algo[counter],totREC_algo[counter]);
01564 
01565   fillPlotFromVector(h_recoeta[counter],totRECeta[counter]);
01566   fillPlotFromVector(h_simuleta[counter],totSIMeta[counter]);
01567   fillPlotFromVector(h_assoceta[counter],totASSeta[counter]);
01568   fillPlotFromVector(h_assoc2eta[counter],totASS2eta[counter]);
01569   fillPlotFromVector(h_loopereta[counter],totloopeta[counter]);
01570   fillPlotFromVector(h_misideta[counter],totmisideta[counter]);
01571   
01572   fillPlotFromVector(h_recopT[counter],totRECpT[counter]);
01573   fillPlotFromVector(h_simulpT[counter],totSIMpT[counter]);
01574   fillPlotFromVector(h_assocpT[counter],totASSpT[counter]);
01575   fillPlotFromVector(h_assoc2pT[counter],totASS2pT[counter]);
01576   fillPlotFromVector(h_looperpT[counter],totlooppT[counter]);
01577   fillPlotFromVector(h_misidpT[counter],totmisidpT[counter]);
01578   
01579   fillPlotFromVector(h_recohit[counter],totREC_hit[counter]);
01580   fillPlotFromVector(h_simulhit[counter],totSIM_hit[counter]);
01581   fillPlotFromVector(h_assochit[counter],totASS_hit[counter]);
01582   fillPlotFromVector(h_assoc2hit[counter],totASS2_hit[counter]);
01583   fillPlotFromVector(h_looperhit[counter],totloop_hit[counter]);
01584   fillPlotFromVector(h_misidhit[counter],totmisid_hit[counter]);
01585   
01586   fillPlotFromVector(h_recophi[counter],totREC_phi[counter]);
01587   fillPlotFromVector(h_simulphi[counter],totSIM_phi[counter]);
01588   fillPlotFromVector(h_assocphi[counter],totASS_phi[counter]);
01589   fillPlotFromVector(h_assoc2phi[counter],totASS2_phi[counter]);
01590   fillPlotFromVector(h_looperphi[counter],totloop_phi[counter]);
01591   fillPlotFromVector(h_misidphi[counter],totmisid_phi[counter]);
01592   
01593   fillPlotFromVector(h_recodxy[counter],totREC_dxy[counter]);
01594   fillPlotFromVector(h_simuldxy[counter],totSIM_dxy[counter]);
01595   fillPlotFromVector(h_assocdxy[counter],totASS_dxy[counter]);
01596   fillPlotFromVector(h_assoc2dxy[counter],totASS2_dxy[counter]);
01597   fillPlotFromVector(h_looperdxy[counter],totloop_dxy[counter]);
01598   fillPlotFromVector(h_misiddxy[counter],totmisid_dxy[counter]);
01599 
01600   fillPlotFromVector(h_recodz[counter],totREC_dz[counter]);
01601   fillPlotFromVector(h_simuldz[counter],totSIM_dz[counter]);
01602   fillPlotFromVector(h_assocdz[counter],totASS_dz[counter]);
01603   fillPlotFromVector(h_assoc2dz[counter],totASS2_dz[counter]);
01604   fillPlotFromVector(h_looperdz[counter],totloop_dz[counter]);
01605   fillPlotFromVector(h_misiddz[counter],totmisid_dz[counter]);
01606   
01607   fillPlotFromVector(h_simulvertpos[counter],totSIM_vertpos[counter]);
01608   fillPlotFromVector(h_assocvertpos[counter],totASS_vertpos[counter]);
01609   
01610   fillPlotFromVector(h_simulzpos[counter],totSIM_zpos[counter]);
01611   fillPlotFromVector(h_assoczpos[counter],totASS_zpos[counter]);  
01612 
01613   fillPlotFromVector(h_reco_vertcount_entire[counter],totREC_vertcount_entire[counter]);
01614   fillPlotFromVector(h_simul_vertcount_entire[counter],totSIM_vertcount_entire[counter]);
01615   fillPlotFromVector(h_assoc_vertcount_entire[counter],totASS_vertcount_entire[counter]);
01616   fillPlotFromVector(h_assoc2_vertcount_entire[counter],totASS2_vertcount_entire[counter]);
01617   
01618   fillPlotFromVector(h_reco_vertcount_barrel[counter],totREC_vertcount_barrel[counter]);
01619   fillPlotFromVector(h_simul_vertcount_barrel[counter],totSIM_vertcount_barrel[counter]);
01620   fillPlotFromVector(h_assoc_vertcount_barrel[counter],totASS_vertcount_barrel[counter]);
01621   fillPlotFromVector(h_assoc2_vertcount_barrel[counter],totASS2_vertcount_barrel[counter]);
01622   
01623   fillPlotFromVector(h_reco_vertcount_fwdpos[counter],totREC_vertcount_fwdpos[counter]);
01624   fillPlotFromVector(h_simul_vertcount_fwdpos[counter],totSIM_vertcount_fwdpos[counter]);
01625   fillPlotFromVector(h_assoc_vertcount_fwdpos[counter],totASS_vertcount_fwdpos[counter]);
01626   fillPlotFromVector(h_assoc2_vertcount_fwdpos[counter],totASS2_vertcount_fwdpos[counter]);
01627   
01628   fillPlotFromVector(h_reco_vertcount_fwdneg[counter],totREC_vertcount_fwdneg[counter]);
01629   fillPlotFromVector(h_simul_vertcount_fwdneg[counter],totSIM_vertcount_fwdneg[counter]);
01630   fillPlotFromVector(h_assoc_vertcount_fwdneg[counter],totASS_vertcount_fwdneg[counter]);
01631   fillPlotFromVector(h_assoc2_vertcount_fwdneg[counter],totASS2_vertcount_fwdneg[counter]);
01632   
01633   fillPlotFromVector(h_simul_vertz_entire[counter],totSIM_vertz_entire[counter]);
01634   fillPlotFromVector(h_assoc_vertz_entire[counter],totASS_vertz_entire[counter]);
01635   
01636   fillPlotFromVector(h_simul_vertz_barrel[counter],totSIM_vertz_barrel[counter]);
01637   fillPlotFromVector(h_assoc_vertz_barrel[counter],totASS_vertz_barrel[counter]);
01638   
01639   fillPlotFromVector(h_simul_vertz_fwdpos[counter],totSIM_vertz_fwdpos[counter]);
01640   fillPlotFromVector(h_assoc_vertz_fwdpos[counter],totASS_vertz_fwdpos[counter]);
01641   
01642   fillPlotFromVector(h_simul_vertz_fwdneg[counter],totSIM_vertz_fwdneg[counter]);
01643   fillPlotFromVector(h_assoc_vertz_fwdneg[counter],totASS_vertz_fwdneg[counter]);
01644   
01645   fillPlotFromVector(h_reco_ootpu_entire[counter],totREC_ootpu_entire[counter]);
01646   fillPlotFromVector(h_assoc2_ootpu_entire[counter],totASS2_ootpu_entire[counter]);
01647   
01648   fillPlotFromVector(h_reco_ootpu_barrel[counter],totREC_ootpu_barrel[counter]);
01649   fillPlotFromVector(h_assoc2_ootpu_barrel[counter],totASS2_ootpu_barrel[counter]);
01650   
01651   fillPlotFromVector(h_reco_ootpu_fwdpos[counter],totREC_ootpu_fwdpos[counter]);
01652   fillPlotFromVector(h_assoc2_ootpu_fwdpos[counter],totASS2_ootpu_fwdpos[counter]);
01653   
01654   fillPlotFromVector(h_reco_ootpu_fwdneg[counter],totREC_ootpu_fwdneg[counter]);
01655   fillPlotFromVector(h_assoc2_ootpu_fwdneg[counter],totASS2_ootpu_fwdneg[counter]);
01656 
01657   fillPlotFromVector(h_con_eta[counter],totCONeta[counter]);
01658   fillPlotFromVector(h_con_vertcount[counter],totCONvertcount[counter]);
01659   fillPlotFromVector(h_con_zpos[counter],totCONzpos[counter]);
01660   
01661 }
01662 
01663 
01664 
01665 
01666 
01667 
01668 void MTVHistoProducerAlgoForTracker::fill_recoAssociated_simTrack_histos(int count,
01669                                                                          const reco::GenParticle& tp,
01670                                                                          const TrackingParticle::Vector& momentumTP,
01671                                                                          const TrackingParticle::Point& vertexTP,
01672                                                                          double dxySim, double dzSim, int nSimHits,
01673                                                                          const reco::Track* track,
01674                                                                          int numVertices, double vertz){
01675   bool isMatched = track;
01676 
01677   if((*GpSelectorForEfficiencyVsEta)(tp)){
01678     //effic vs hits
01679     int nSimHitsInBounds = std::min((int)nSimHits,int(maxHit-1));
01680     totSIM_hit[count][nSimHitsInBounds]++;
01681     if(isMatched) {
01682       totASS_hit[count][nSimHitsInBounds]++;
01683       nrecHit_vs_nsimHit_sim2rec[count]->Fill( track->numberOfValidHits(),nSimHits);
01684     }
01685 
01686     //effic vs eta
01687     for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
01688       if (getEta(momentumTP.eta())>etaintervals[count][f]&&
01689           getEta(momentumTP.eta())<etaintervals[count][f+1]) {
01690         totSIMeta[count][f]++;
01691         if (isMatched) {
01692           totASSeta[count][f]++;
01693         }
01694       }
01695 
01696     } // END for (unsigned int f=0; f<etaintervals[w].size()-1; f++){
01697 
01698     //effic vs num pileup vertices
01699     for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
01700       if (numVertices == vertcountintervals[count][f]) {
01701         totSIM_vertcount_entire[count][f]++;
01702         if (isMatched) {
01703           totASS_vertcount_entire[count][f]++;
01704         }
01705       }
01706       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() <= 0.9 && momentumTP.eta() >= -0.9) {
01707         totSIM_vertcount_barrel[count][f]++;
01708         if (isMatched) {
01709           totASS_vertcount_barrel[count][f]++;
01710         }
01711       }
01712       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() > 0.9) {
01713         totSIM_vertcount_fwdpos[count][f]++;
01714         if (isMatched) {
01715           totASS_vertcount_fwdpos[count][f]++;
01716         }
01717       }
01718       if (numVertices == vertcountintervals[count][f] && momentumTP.eta() < -0.9) {
01719         totSIM_vertcount_fwdneg[count][f]++;
01720         if (isMatched) {
01721           totASS_vertcount_fwdneg[count][f]++;
01722         }
01723       }
01724     }
01725 
01726   }
01727 
01728   if((*GpSelectorForEfficiencyVsPhi)(tp)){
01729     for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
01730       if (momentumTP.phi() > phiintervals[count][f]&&
01731           momentumTP.phi() <phiintervals[count][f+1]) {
01732         totSIM_phi[count][f]++;
01733         if (isMatched) {
01734           totASS_phi[count][f]++;
01735         }
01736       }
01737     } // END for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
01738   }
01739         
01740   if((*GpSelectorForEfficiencyVsPt)(tp)){
01741     for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
01742       if (getPt(sqrt(momentumTP.perp2()))>pTintervals[count][f]&&
01743           getPt(sqrt(momentumTP.perp2()))<pTintervals[count][f+1]) {
01744         totSIMpT[count][f]++;
01745         if (isMatched) {
01746           totASSpT[count][f]++;
01747         }
01748       }
01749     } // END for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
01750   }     
01751 
01752   if((*GpSelectorForEfficiencyVsVTXR)(tp)){
01753     for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
01754       if (dxySim>dxyintervals[count][f]&&
01755           dxySim<dxyintervals[count][f+1]) {
01756         totSIM_dxy[count][f]++;
01757         if (isMatched) {
01758           totASS_dxy[count][f]++;
01759         }
01760       }
01761     } // END for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
01762 
01763     for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
01764       if (sqrt(vertexTP.perp2())>vertposintervals[count][f]&&
01765           sqrt(vertexTP.perp2())<vertposintervals[count][f+1]) {
01766         totSIM_vertpos[count][f]++;
01767         if (isMatched) {
01768           totASS_vertpos[count][f]++;
01769         }
01770       }
01771     } // END for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
01772   }
01773 
01774   if((*GpSelectorForEfficiencyVsVTXZ)(tp)){
01775     for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
01776       if (dzSim>dzintervals[count][f]&&
01777           dzSim<dzintervals[count][f+1]) {
01778         totSIM_dz[count][f]++;
01779         if (isMatched) {
01780           totASS_dz[count][f]++;
01781         }
01782       }
01783     } // END for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
01784 
01785   
01786     for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
01787         if (vertexTP.z()>zposintervals[count][f]&&vertexTP.z()<zposintervals[count][f+1]) {
01788                 totSIM_zpos[count][f]++;
01789                 if (isMatched) totASS_zpos[count][f]++;
01790         }
01791         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1]) {
01792                 totSIM_vertz_entire[count][f]++;
01793                 if (isMatched) totASS_vertz_entire[count][f]++;
01794         }
01795         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && fabs(momentumTP.eta())<0.9) {
01796                 totSIM_vertz_barrel[count][f]++;
01797                 if (isMatched) totASS_vertz_barrel[count][f]++;
01798         }
01799         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && momentumTP.eta()>0.9) {
01800                 totSIM_vertz_fwdpos[count][f]++;
01801                 if (isMatched) totASS_vertz_fwdpos[count][f]++;
01802         }
01803         if (vertz>zposintervals[count][f]&&vertz<zposintervals[count][f+1] && momentumTP.eta()<-0.9) {
01804                 totSIM_vertz_fwdneg[count][f]++;
01805                 if (isMatched) totASS_vertz_fwdneg[count][f]++;
01806         }
01807     } // END for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
01808   }
01809 
01810   //Special investigations for PU  
01811   if(((*GpSelectorForEfficiencyVsCon)(tp)) && (!((*GpSelectorForEfficiencyVsEta)(tp)))){
01812 
01813    //efficPU vs eta
01814     for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
01815       if (getEta(momentumTP.eta())>etaintervals[count][f]&&
01816           getEta(momentumTP.eta())<etaintervals[count][f+1]) {
01817         totCONeta[count][f]++;
01818       }
01819     } // END for (unsigned int f=0; f<etaintervals[w].size()-1; f++){
01820 
01821     //efficPU vs num pileup vertices
01822     for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
01823       if (numVertices == vertcountintervals[count][f]) {
01824         totCONvertcount[count][f]++;
01825       }
01826     } // END for (unsigned int f=0; f<vertcountintervals[count].size()-1; f++){
01827   
01828     for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
01829       if (vertexTP.z()>zposintervals[count][f]&&vertexTP.z()<zposintervals[count][f+1]) {
01830         totCONzpos[count][f]++;
01831       }
01832     } // END for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
01833 
01834   }
01835 
01836 }