CMS 3D CMS Logo

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