CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
PrimaryVertexValidation Class Reference

#include <Alignment/OfflineValidation/plugins/PrimaryVertexValidation.cc>

Inheritance diagram for PrimaryVertexValidation:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PrimaryVertexValidation (const edm::ParameterSet &)
 
 ~PrimaryVertexValidation () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void add (std::map< std::string, TH1 * > &h, TH1 *hist)
 
void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
std::vector< TH1F * > bookResidualsHistogram (const TFileDirectory &dir, unsigned int theNOfBins, PVValHelper::residualType resType, PVValHelper::plotVariable varType, bool isNormalized=false)
 
std::map< std::string, TH1 * > bookVertexHistograms (const TFileDirectory &dir)
 
void endJob () override
 
void fill (std::map< std::string, TH1 * > &h, const std::string &s, double x)
 
void fill (std::map< std::string, TH1 * > &h, const std::string &s, double x, double y)
 
void fillByIndex (std::vector< TH1F * > &h, unsigned int index, double x, std::string tag="")
 
void fillMap (TH2F *trendMap, TH1F *residualsMapPlot[100][100], PVValHelper::estimator fitPar_)
 
void fillTrackHistos (std::map< std::string, TH1 * > &h, const std::string &ttype, const reco::TransientTrack *tt, const reco::Vertex &v, const reco::BeamSpot &beamSpot, double fBfield)
 
void fillTrendPlot (TH1F *trendPlot, TH1F *residualsPlot[100], PVValHelper::estimator fitPar_, const std::string &var_)
 
void fillTrendPlotByIndex (TH1F *trendPlot, std::vector< TH1F * > &h, PVValHelper::estimator fitPar_, PVValHelper::plotVariable plotVar=PVValHelper::END_OF_PLOTS)
 
std::pair< Measurement1D, Measurement1DfitResiduals (TH1 *hist)
 
Measurement1D getMAD (TH1F *histo)
 
Measurement1D getMedian (TH1F *histo)
 
std::tuple< std::string, std::string, std::string > getTypeString (PVValHelper::residualType type)
 
std::tuple< std::string, std::string, std::string > getVarString (PVValHelper::plotVariable var)
 
bool hasFirstLayerPixelHits (const reco::TransientTrack &track)
 
bool isBFieldConsistentWithMode (const edm::EventSetup &iSetup) const
 
bool isHit2D (const TrackingRecHit &hit) const
 
bool passesTrackCuts (const reco::Track &track, const reco::Vertex &vertex, const std::string &qualityString_, double dxyErrMax_, double dzErrMax_, double ptErrMax_)
 
std::pair< bool, bool > pixelHitsCheck (const reco::TransientTrack &track)
 
void SetVarToZero ()
 
void shrinkHistVectorToFit (std::vector< TH1F * > &h, unsigned int desired_size)
 
double square (double x)
 

Static Private Member Functions

static bool vtxSort (const reco::Vertex &a, const reco::Vertex &b)
 

Private Attributes

std::vector< TH1F * > a_d3DEtaResiduals
 
std::vector< TH1F * > a_d3DPhiResiduals
 
TH1F * a_d3DResidualsMap [nMaxBins_][nMaxBins_]
 
std::vector< TH1F * > a_dxEtaResiduals
 
std::vector< TH1F * > a_dxPhiResiduals
 
TH1F * a_dxyBiasResidualsMap [nMaxBins_][nMaxBins_]
 
std::vector< TH1F * > a_dxyEtaBiasResiduals
 
TH1F * a_dxyEtaMADBiasTrend
 
TH1F * a_dxyEtaMADTrend
 
TH1F * a_dxyEtaMeanBiasTrend
 
TH1F * a_dxyEtaMeanTrend
 
TH1F * a_dxyEtaMedianBiasTrend
 
TH1F * a_dxyEtaMedianTrend
 
std::vector< TH1F * > a_dxyEtaResiduals
 
TH1F * a_dxyEtaWidthBiasTrend
 
TH1F * a_dxyEtaWidthTrend
 
TH1F * a_dxyladderMeanTrend
 
TH1F * a_dxyladderWidthTrend
 
TH2F * a_dxyMeanBiasMap
 
TH2F * a_dxyMeanMap
 
TH1F * a_dxymodZMeanTrend
 
TH1F * a_dxymodZWidthTrend
 
std::vector< TH1F * > a_dxyPhiBiasResiduals
 
TH1F * a_dxyPhiMADBiasTrend
 
TH1F * a_dxyPhiMADTrend
 
TH1F * a_dxyPhiMeanBiasTrend
 
TH1F * a_dxyPhiMeanTrend
 
TH1F * a_dxyPhiMedianBiasTrend
 
TH1F * a_dxyPhiMedianTrend
 
std::vector< TH1F * > a_dxyPhiResiduals
 
TH1F * a_dxyPhiWidthBiasTrend
 
TH1F * a_dxyPhiWidthTrend
 
TH1F * a_dxypTCentralMeanTrend
 
TH1F * a_dxypTCentralWidthTrend
 
TH1F * a_dxypTMeanTrend
 
TH1F * a_dxypTWidthTrend
 
TH1F * a_dxyResidualsMap [nMaxBins_][nMaxBins_]
 
TH2F * a_dxyVsEta
 
TH2F * a_dxyVsPhi
 
TH2F * a_dxyWidthBiasMap
 
TH2F * a_dxyWidthMap
 
std::vector< TH1F * > a_dyEtaResiduals
 
std::vector< TH1F * > a_dyPhiResiduals
 
TH1F * a_dzBiasResidualsMap [nMaxBins_][nMaxBins_]
 
std::vector< TH1F * > a_dzEtaBiasResiduals
 
TH1F * a_dzEtaMADBiasTrend
 
TH1F * a_dzEtaMADTrend
 
TH1F * a_dzEtaMeanBiasTrend
 
TH1F * a_dzEtaMeanTrend
 
TH1F * a_dzEtaMedianBiasTrend
 
TH1F * a_dzEtaMedianTrend
 
std::vector< TH1F * > a_dzEtaResiduals
 
TH1F * a_dzEtaWidthBiasTrend
 
TH1F * a_dzEtaWidthTrend
 
TH1F * a_dzladderMeanTrend
 
TH1F * a_dzladderWidthTrend
 
TH2F * a_dzMeanBiasMap
 
TH2F * a_dzMeanMap
 
TH1F * a_dzmodZMeanTrend
 
TH1F * a_dzmodZWidthTrend
 
std::vector< TH1F * > a_dzPhiBiasResiduals
 
TH1F * a_dzPhiMADBiasTrend
 
TH1F * a_dzPhiMADTrend
 
TH1F * a_dzPhiMeanBiasTrend
 
TH1F * a_dzPhiMeanTrend
 
TH1F * a_dzPhiMedianBiasTrend
 
TH1F * a_dzPhiMedianTrend
 
std::vector< TH1F * > a_dzPhiResiduals
 
TH1F * a_dzPhiWidthBiasTrend
 
TH1F * a_dzPhiWidthTrend
 
TH1F * a_dzpTCentralMeanTrend
 
TH1F * a_dzpTCentralWidthTrend
 
TH1F * a_dzpTMeanTrend
 
TH1F * a_dzpTWidthTrend
 
TH1F * a_dzResidualsMap [nMaxBins_][nMaxBins_]
 
TH2F * a_dzVsEta
 
TH2F * a_dzVsPhi
 
TH2F * a_dzWidthBiasMap
 
TH2F * a_dzWidthMap
 
std::vector< TH1F * > a_IP2DEtaResiduals
 
std::vector< TH1F * > a_IP2DPhiResiduals
 
std::vector< TH1F * > a_IP3DEtaResiduals
 
std::vector< TH1F * > a_IP3DPhiResiduals
 
std::vector< TH1F * > a_reszEtaResiduals
 
std::vector< TH1F * > a_reszPhiResiduals
 
bool askFirstLayerHit_
 
double Beamdxdz_
 
double Beamsigmaz_
 
double BeamWidthX_
 
double BeamWidthY_
 
double BSx0_
 
double BSy0_
 
double BSz0_
 
int charge_ [nMaxtracks_]
 
double chi2_ [nMaxtracks_]
 
double chi2ndof_ [nMaxtracks_]
 
float chi2normUnbiasedVertex_ [nMaxtracks_]
 
float chi2ProbUnbiasedVertex_ [nMaxtracks_]
 
float chi2UnbiasedVertex_ [nMaxtracks_]
 
double d3DErrorFromMyVertex_ [nMaxtracks_]
 
double d3DFromMyVertex_ [nMaxtracks_]
 
bool debug_
 
bool doBPix_
 
bool doFPix_
 
float DOFUnbiasedVertex_ [nMaxtracks_]
 
double dxy_ [nMaxtracks_]
 
double dxyBs_ [nMaxtracks_]
 
double dxyErrorFromMyVertex_ [nMaxtracks_]
 
double dxyFromMyVertex_ [nMaxtracks_]
 
double dz_ [nMaxtracks_]
 
double dzBs_ [nMaxtracks_]
 
double dzErrorFromMyVertex_ [nMaxtracks_]
 
double dzFromMyVertex_ [nMaxtracks_]
 
double eta_ [nMaxtracks_]
 
double etaOfProbe_
 
unsigned int EventNumber_
 
bool forceBeamSpotContraint_
 
edm::Service< TFileServicefs
 
TH2F * h2_probeEtaPhi_
 
TH2F * h2_probeEtaPt_
 
TH1F * h_Beamsigmaz
 
TH1F * h_BeamWidthX
 
TH1F * h_BeamWidthY
 
TH1F * h_BSx0
 
TH1F * h_BSy0
 
TH1F * h_BSz0
 
std::vector< TH1F * > h_dxy_Central_pT_
 
std::vector< TH1F * > h_dxy_ladder_
 
std::vector< TH1F * > h_dxy_ladderNoOverlap_
 
std::vector< TH1F * > h_dxy_ladderOverlap_
 
std::vector< TH1F * > h_dxy_modZ_
 
std::vector< TH1F * > h_dxy_pT_
 
std::vector< TH1F * > h_dz_Central_pT_
 
std::vector< TH1F * > h_dz_ladder_
 
std::vector< TH1F * > h_dz_modZ_
 
std::vector< TH1F * > h_dz_pT_
 
TH1F * h_etaMax
 
TH1F * h_fitVtxChi2_
 
TH1F * h_fitVtxChi2ndf_
 
TH1F * h_fitVtxChi2Prob_
 
TH1F * h_fitVtxNdof_
 
TH1F * h_fitVtxNtracks_
 
TH1F * h_fitVtxTrackAverageWeight_
 
TH1F * h_fitVtxTrackWeights_
 
TH1F * h_lumiFromConfig
 
TH1F * h_nbins
 
TH1F * h_nClus
 
TH1F * h_nLadders
 
TH1F * h_nOfflineVertices
 
std::vector< TH1F * > h_norm_dxy_Central_pT_
 
std::vector< TH1F * > h_norm_dxy_ladder_
 
std::vector< TH1F * > h_norm_dxy_modZ_
 
std::vector< TH1F * > h_norm_dxy_pT_
 
std::vector< TH1F * > h_norm_dz_Central_pT_
 
std::vector< TH1F * > h_norm_dz_ladder_
 
std::vector< TH1F * > h_norm_dz_modZ_
 
std::vector< TH1F * > h_norm_dz_pT_
 
TH1F * h_nTracks
 
TH1F * h_probeCharge_
 
TH1F * h_probeChi2_
 
TH1F * h_probed0RefitV_
 
TH1F * h_probed3DRefitV_
 
TH1F * h_probedxyRecoV_
 
TH1F * h_probedxyRefitV_
 
TH1F * h_probedzRecoV_
 
TH1F * h_probedzRefitV_
 
TH1F * h_probeEta_
 
TH1I * h_probeHasBPixL1Overlap_
 
TH1F * h_probeHits1D_
 
TH1F * h_probeHits2D_
 
TH1F * h_probeHits_
 
TH1F * h_probeHitsInBPIX_
 
TH1F * h_probeHitsInFPIX_
 
TH1F * h_probeHitsInTEC_
 
TH1F * h_probeHitsInTIB_
 
TH1F * h_probeHitsInTID_
 
TH1F * h_probeHitsInTOB_
 
TH1F * h_probeL1Ladder_
 
TH1F * h_probeL1Module_
 
TH1F * h_probeNormChi2_
 
TH1F * h_probeP_
 
TH1F * h_probePhi_
 
TH1F * h_probePt_
 
TH1F * h_probePtRebin_
 
TH1F * h_probeQoverP_
 
TH1F * h_probeRecoVSigXY_
 
TH1F * h_probeRecoVSigZ_
 
TH1F * h_probeRefitVLogSig3D_
 
TH1F * h_probeRefitVSig3D_
 
TH1F * h_probeRefitVSigResZ_
 
TH1F * h_probeRefitVSigXY_
 
TH1F * h_probeRefitVSigZ_
 
TH1F * h_probereszRefitV_
 
TH1F * h_probesignIP2DRefitV_
 
TH1F * h_probez0RefitV_
 
TH1F * h_pTinfo
 
TH1F * h_recoVtxChi2ndf_
 
TH1F * h_recoVtxChi2Prob_
 
TH1F * h_recoVtxNtracks_
 
TH1F * h_recoVtxSumPt_
 
TH1I * h_runFromConfig
 
TH1I * h_runFromEvent
 
TH1F * h_runNumber
 
TH1F * h_xErrOfflineVertex
 
TH1F * h_xOfflineVertex
 
TH1F * h_yErrOfflineVertex
 
TH1F * h_yOfflineVertex
 
TH1F * h_zErrOfflineVertex
 
TH1F * h_zOfflineVertex
 
int hasRecVertex_ [nMaxtracks_]
 
std::map< std::string, TH1 * > hDA
 
double intLumi_
 
double IP3DsigFromMyVertex_ [nMaxtracks_]
 
double IPLsigFromMyVertex_ [nMaxtracks_]
 
double IPTsigFromMyVertex_ [nMaxtracks_]
 
int isGoodTrack_ [nMaxtracks_]
 
int isHighPurity_ [nMaxtracks_]
 
bool isPhase1_
 
bool lightNtupleSwitch_
 
unsigned int LuminosityBlockNumber_
 
TFileDirectory MADTrendsDir
 
const double maxPt_
 
TFileDirectory Mean2DMapsDir
 
TFileDirectory MeanTrendsDir
 
TFileDirectory MedianTrendsDir
 
const double minPt_
 
std::array< float, nPtBins_+1 > mypT_bins_
 
std::vector< TH1F * > n_d3DEtaResiduals
 
std::vector< TH1F * > n_d3DPhiResiduals
 
TH1F * n_d3DResidualsMap [nMaxBins_][nMaxBins_]
 
TH1F * n_dxyBiasResidualsMap [nMaxBins_][nMaxBins_]
 
std::vector< TH1F * > n_dxyEtaBiasResiduals
 
TH1F * n_dxyEtaMADBiasTrend
 
TH1F * n_dxyEtaMADTrend
 
TH1F * n_dxyEtaMeanBiasTrend
 
TH1F * n_dxyEtaMeanTrend
 
TH1F * n_dxyEtaMedianBiasTrend
 
TH1F * n_dxyEtaMedianTrend
 
std::vector< TH1F * > n_dxyEtaResiduals
 
TH1F * n_dxyEtaWidthBiasTrend
 
TH1F * n_dxyEtaWidthTrend
 
TH1F * n_dxyladderMeanTrend
 
TH1F * n_dxyladderWidthTrend
 
TH2F * n_dxyMeanBiasMap
 
TH2F * n_dxyMeanMap
 
TH1F * n_dxymodZMeanTrend
 
TH1F * n_dxymodZWidthTrend
 
std::vector< TH1F * > n_dxyPhiBiasResiduals
 
TH1F * n_dxyPhiMADBiasTrend
 
TH1F * n_dxyPhiMADTrend
 
TH1F * n_dxyPhiMeanBiasTrend
 
TH1F * n_dxyPhiMeanTrend
 
TH1F * n_dxyPhiMedianBiasTrend
 
TH1F * n_dxyPhiMedianTrend
 
std::vector< TH1F * > n_dxyPhiResiduals
 
TH1F * n_dxyPhiWidthBiasTrend
 
TH1F * n_dxyPhiWidthTrend
 
TH1F * n_dxypTCentralMeanTrend
 
TH1F * n_dxypTCentralWidthTrend
 
TH1F * n_dxypTMeanTrend
 
TH1F * n_dxypTWidthTrend
 
TH1F * n_dxyResidualsMap [nMaxBins_][nMaxBins_]
 
TH2F * n_dxyVsEta
 
TH2F * n_dxyVsPhi
 
TH2F * n_dxyWidthBiasMap
 
TH2F * n_dxyWidthMap
 
TH1F * n_dzBiasResidualsMap [nMaxBins_][nMaxBins_]
 
std::vector< TH1F * > n_dzEtaBiasResiduals
 
TH1F * n_dzEtaMADBiasTrend
 
TH1F * n_dzEtaMADTrend
 
TH1F * n_dzEtaMeanBiasTrend
 
TH1F * n_dzEtaMeanTrend
 
TH1F * n_dzEtaMedianBiasTrend
 
TH1F * n_dzEtaMedianTrend
 
std::vector< TH1F * > n_dzEtaResiduals
 
TH1F * n_dzEtaWidthBiasTrend
 
TH1F * n_dzEtaWidthTrend
 
TH1F * n_dzladderMeanTrend
 
TH1F * n_dzladderWidthTrend
 
TH2F * n_dzMeanBiasMap
 
TH2F * n_dzMeanMap
 
TH1F * n_dzmodZMeanTrend
 
TH1F * n_dzmodZWidthTrend
 
std::vector< TH1F * > n_dzPhiBiasResiduals
 
TH1F * n_dzPhiMADBiasTrend
 
TH1F * n_dzPhiMADTrend
 
TH1F * n_dzPhiMeanBiasTrend
 
TH1F * n_dzPhiMeanTrend
 
TH1F * n_dzPhiMedianBiasTrend
 
TH1F * n_dzPhiMedianTrend
 
std::vector< TH1F * > n_dzPhiResiduals
 
TH1F * n_dzPhiWidthBiasTrend
 
TH1F * n_dzPhiWidthTrend
 
TH1F * n_dzpTCentralMeanTrend
 
TH1F * n_dzpTCentralWidthTrend
 
TH1F * n_dzpTMeanTrend
 
TH1F * n_dzpTWidthTrend
 
TH1F * n_dzResidualsMap [nMaxBins_][nMaxBins_]
 
TH2F * n_dzVsEta
 
TH2F * n_dzVsPhi
 
TH2F * n_dzWidthBiasMap
 
TH2F * n_dzWidthMap
 
std::vector< TH1F * > n_IP2DEtaResiduals
 
std::vector< TH1F * > n_IP2DPhiResiduals
 
std::vector< TH1F * > n_IP3DEtaResiduals
 
std::vector< TH1F * > n_IP3DPhiResiduals
 
std::vector< TH1F * > n_reszEtaResiduals
 
std::vector< TH1F * > n_reszPhiResiduals
 
int nBins_
 
int nClus_
 
int Nevt_
 
int nhits1D_ [nMaxtracks_]
 
int nhits2D_ [nMaxtracks_]
 
int nhits_ [nMaxtracks_]
 
int nhitsBPIX_ [nMaxtracks_]
 
int nhitsFPIX_ [nMaxtracks_]
 
double nHitsOfProbe_
 
int nhitsTEC_ [nMaxtracks_]
 
int nhitsTIB_ [nMaxtracks_]
 
int nhitsTID_ [nMaxtracks_]
 
int nhitsTOB_ [nMaxtracks_]
 
unsigned int nLadders_ = 20
 
unsigned int nModZ_ = 8
 
int nOfflineVertices_
 
int nTracks_
 
int nTracksPerClus_
 
double p_ [nMaxtracks_]
 
double phi_ [nMaxtracks_]
 
double pOfProbe_
 
double pt_ [nMaxtracks_]
 
double ptOfProbe_
 
double qoverp_ [nMaxtracks_]
 
TTree * rootTree_
 
bool runControl_
 
std::vector< unsigned int > runControlNumbers_
 
unsigned int RunNumber_
 
bool storeNtuple_
 
float sumOfWeightsUnbiasedVertex_ [nMaxtracks_]
 
edm::EDGetTokenT< reco::BeamSpottheBeamspotToken
 
edm::ParameterSet theConfig
 
PVValHelper::histodetails theDetails_
 
double theta_ [nMaxtracks_]
 
TrackClusterizerInZtheTrackClusterizer_
 
edm::EDGetTokenT< reco::TrackCollectiontheTrackCollectionToken
 
TrackFilterForPVFindingBasetheTrackFilter_
 
edm::EDGetTokenT< reco::VertexCollectiontheVertexCollectionToken
 
int tracksUsedForVertexing_ [nMaxtracks_]
 
bool useTracksFromRecoVtx_
 
double vertexZMax_
 
TFileDirectory Width2DMapsDir
 
TFileDirectory WidthTrendsDir
 
double wxy2_
 
double xErrOfflineVertex_
 
double xOfflineVertex_
 
double xPCA_ [nMaxtracks_]
 
double xUnbiasedVertex_ [nMaxtracks_]
 
double yErrOfflineVertex_
 
double yOfflineVertex_
 
double yPCA_ [nMaxtracks_]
 
double yUnbiasedVertex_ [nMaxtracks_]
 
double zErrOfflineVertex_
 
double zOfflineVertex_
 
double zPCA_ [nMaxtracks_]
 
double zUnbiasedVertex_ [nMaxtracks_]
 

Static Private Attributes

static const int cmToum = 10000
 
static const int nMaxBins_ = 100
 
static const int nMaxtracks_ = 1000
 
static const int nPtBins_ = 48
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Validate alignment constants using unbiased vertex residuals

Implementation: <Notes on="" implementation>="">

Definition at line 67 of file PrimaryVertexValidation.h.

Constructor & Destructor Documentation

PrimaryVertexValidation::PrimaryVertexValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 69 of file PrimaryVertexValidation.cc.

References PVValHelper::d3D, debug_, PVValHelper::dx, PVValHelper::dxy, PVValHelper::END_OF_PLOTS, PVValHelper::END_OF_TYPES, PVValHelper::eta, etaOfProbe_, PVValHelper::generateBins(), PVValHelper::histodetails::getHigh(), PVValHelper::histodetails::getLow(), edm::ParameterSet::getParameter(), PVValHelper::getTypeString(), edm::ParameterSet::getUntrackedParameter(), PVValHelper::getVarString(), PVValHelper::histodetails::histobins, mps_fire::i, TFileService::kSharedResource, PVValHelper::ladder, maxPt_, minPt_, PVValHelper::modZ, mypT_bins_, nBins_, PVValHelper::norm_d3D, PVValHelper::phi, PVValHelper::pT, PVValHelper::pTCentral, PVValHelper::histodetails::range, runControlNumbers_, PVValHelper::histodetails::setMap(), AlCaHLTBitMon_QueryRunRegistry::string, theBeamspotToken, theDetails_, theTrackClusterizer_, theTrackCollectionToken, theTrackFilter_, theVertexCollectionToken, and PVValHelper::histodetails::trendbins.

69  :
70  storeNtuple_(iConfig.getParameter<bool>("storeNtuple")),
71  lightNtupleSwitch_(iConfig.getParameter<bool>("isLightNtuple")),
72  useTracksFromRecoVtx_(iConfig.getParameter<bool>("useTracksFromRecoVtx")),
73  vertexZMax_(iConfig.getUntrackedParameter<double>("vertexZMax",99.)),
74  intLumi_(iConfig.getUntrackedParameter<double>("intLumi",0.)),
75  askFirstLayerHit_(iConfig.getParameter<bool>("askFirstLayerHit")),
76  doBPix_(iConfig.getUntrackedParameter<bool>("doBPix",true)),
77  doFPix_(iConfig.getUntrackedParameter<bool>("doFPix",true)),
78  ptOfProbe_(iConfig.getUntrackedParameter<double>("probePt",0.)),
79  pOfProbe_(iConfig.getUntrackedParameter<double>("probeP",0.)),
80  etaOfProbe_(iConfig.getUntrackedParameter<double>("probeEta",2.4)),
81  nHitsOfProbe_(iConfig.getUntrackedParameter<double>("probeNHits",0.)),
82  nBins_(iConfig.getUntrackedParameter<int>("numberOfBins",24)),
83  minPt_(iConfig.getUntrackedParameter<double>("minPt",1.)),
84  maxPt_(iConfig.getUntrackedParameter<double>("maxPt",20.)),
85  debug_(iConfig.getParameter<bool>("Debug")),
86  runControl_(iConfig.getUntrackedParameter<bool>("runControl",false)),
87  forceBeamSpotContraint_(iConfig.getUntrackedParameter<bool>("forceBeamSpot",false))
88 {
89 
90  // now do what ever initialization is needed
91  // initialize phase space boundaries
92 
93  usesResource(TFileService::kSharedResource);
94 
95  std::vector<unsigned int> defaultRuns;
96  defaultRuns.push_back(0);
97  runControlNumbers_ = iConfig.getUntrackedParameter<std::vector<unsigned int> >("runControlNumber",defaultRuns);
98 
99  edm::InputTag TrackCollectionTag_ = iConfig.getParameter<edm::InputTag>("TrackCollectionTag");
100  theTrackCollectionToken = consumes<reco::TrackCollection>(TrackCollectionTag_);
101 
102  edm::InputTag VertexCollectionTag_ = iConfig.getParameter<edm::InputTag>("VertexCollectionTag");
103  theVertexCollectionToken = consumes<reco::VertexCollection>(VertexCollectionTag_);
104 
105  edm::InputTag BeamspotTag_ = edm::InputTag("offlineBeamSpot");
106  theBeamspotToken = consumes<reco::BeamSpot>(BeamspotTag_);
107 
108  // select and configure the track filter
109  theTrackFilter_= new TrackFilterForPVFinding(iConfig.getParameter<edm::ParameterSet>("TkFilterParameters") );
110  // select and configure the track clusterizer
111  std::string clusteringAlgorithm=iConfig.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<std::string>("algorithm");
112  if (clusteringAlgorithm=="gap"){
113  theTrackClusterizer_ = new GapClusterizerInZ(iConfig.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<edm::ParameterSet>("TkGapClusParameters"));
114  }else if(clusteringAlgorithm=="DA"){
115  theTrackClusterizer_ = new DAClusterizerInZ(iConfig.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<edm::ParameterSet>("TkDAClusParameters"));
116  // provide the vectorized version of the clusterizer, if supported by the build
117  } else if(clusteringAlgorithm=="DA_vect") {
118  theTrackClusterizer_ = new DAClusterizerInZ_vect(iConfig.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<edm::ParameterSet>("TkDAClusParameters"));
119  } else {
120  throw VertexException("PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
121  }
122 
123  theDetails_.histobins = 500;
130 
131  for (int i = PVValHelper::phi; i < PVValHelper::END_OF_PLOTS; i++ ){
132  for (int j = PVValHelper::dx; j < PVValHelper::END_OF_TYPES; j++ ){
133 
134  auto plot_index = static_cast<PVValHelper::plotVariable>(i);
135  auto res_index = static_cast<PVValHelper::residualType>(j);
136 
137  if(debug_){
138  edm::LogInfo("PrimaryVertexValidation")<<"==> "<<std::get<0>(PVValHelper::getTypeString(res_index)) << " "<< std::setw(10)<< std::get<0>(PVValHelper::getVarString(plot_index))<<std::endl;
139  }
140  if(res_index!=PVValHelper::d3D && res_index!=PVValHelper::norm_d3D)
141  theDetails_.setMap(res_index,plot_index,theDetails_.getLow(PVValHelper::dxy,plot_index),theDetails_.getHigh(PVValHelper::dxy,plot_index));
142  else
143  theDetails_.setMap(res_index,plot_index,0.,theDetails_.getHigh(PVValHelper::dxy,plot_index));
144  }
145  }
146 
147  edm::LogVerbatim("PrimaryVertexValidation") <<"######################################";
148  for (const auto & it : theDetails_.range){
149  edm::LogVerbatim("PrimaryVertexValidation")<< "|" <<std::setw(10) << std::get<0>(PVValHelper::getTypeString(it.first.first)) << "|" << std::setw(10)<< std::get<0>(PVValHelper::getVarString(it.first.second)) << "| (" << std::setw(5)<< it.second.first << ";" <<std::setw(5)<< it.second.second << ") |"<<std::endl;
150  }
151 
154 
155  if(debug_){
156  edm::LogVerbatim("PrimaryVertexValidation") << "etaBins: ";
157  for (auto ieta: theDetails_.trendbins[PVValHelper::eta]) {
158  edm::LogVerbatim("PrimaryVertexValidation") << ieta << " ";
159  }
160  edm::LogVerbatim("PrimaryVertexValidation") << "\n";
161 
162  edm::LogVerbatim("PrimaryVertexValidation") << "phiBins: ";
163  for (auto iphi: theDetails_.trendbins[PVValHelper::phi]) {
164  edm::LogVerbatim("PrimaryVertexValidation") << iphi << " ";
165  }
166  edm::LogVerbatim("PrimaryVertexValidation") << "\n";
167  }
168 
169  // create the bins of the pT-binned distributions
170 
171  mypT_bins_ = PVValHelper::makeLogBins<float,nPtBins_>(minPt_,maxPt_);
172 
173  std::string toOutput="";
174  for (auto ptbin: mypT_bins_){
175  toOutput+=" ";
176  toOutput+=std::to_string(ptbin);
177  toOutput+=",";
178  }
179 
180  edm::LogVerbatim("PrimaryVertexValidation") <<"######################################\n";
181  edm::LogVerbatim("PrimaryVertexValidation") <<"The pT binning is: [" << toOutput << "] \n";
182 
183 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< unsigned int > runControlNumbers_
TrackFilterForPVFindingBase * theTrackFilter_
Common base class.
std::vector< float > generateBins(int n, float start, float range)
plotLabels getVarString(plotVariable var)
float getHigh(residualType type, plotVariable plot)
float getLow(residualType type, plotVariable plot)
std::map< plotVariable, std::vector< float > > trendbins
edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionToken
void setMap(residualType type, plotVariable plot, float low, float high)
std::map< std::pair< residualType, plotVariable >, std::pair< float, float > > range
plotLabels getTypeString(residualType type)
TrackClusterizerInZ * theTrackClusterizer_
edm::EDGetTokenT< reco::BeamSpot > theBeamspotToken
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
std::array< float, nPtBins_+1 > mypT_bins_
PVValHelper::histodetails theDetails_
PrimaryVertexValidation::~PrimaryVertexValidation ( )
override

Definition at line 186 of file PrimaryVertexValidation.cc.

References theTrackClusterizer_, and theTrackFilter_.

187 {
188  // do anything here that needs to be done at desctruction time
189  // (e.g. close files, deallocate resources etc.)
190  if (theTrackFilter_) delete theTrackFilter_;
192 }
TrackFilterForPVFindingBase * theTrackFilter_
TrackClusterizerInZ * theTrackClusterizer_

Member Function Documentation

void PrimaryVertexValidation::add ( std::map< std::string, TH1 * > &  h,
TH1 *  hist 
)
private
void PrimaryVertexValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 201 of file PrimaryVertexValidation.cc.

References a_d3DEtaResiduals, a_d3DPhiResiduals, a_d3DResidualsMap, a_dxEtaResiduals, a_dxPhiResiduals, a_dxyBiasResidualsMap, a_dxyEtaBiasResiduals, a_dxyEtaResiduals, a_dxyPhiBiasResiduals, a_dxyPhiResiduals, a_dxyResidualsMap, a_dxyVsEta, a_dxyVsPhi, a_dyEtaResiduals, a_dyPhiResiduals, a_dzBiasResidualsMap, a_dzEtaBiasResiduals, a_dzEtaResiduals, a_dzPhiBiasResiduals, a_dzPhiResiduals, a_dzResidualsMap, a_dzVsEta, a_dzVsPhi, a_IP2DEtaResiduals, a_IP2DPhiResiduals, a_IP3DEtaResiduals, a_IP3DPhiResiduals, a_reszEtaResiduals, a_reszPhiResiduals, funct::abs(), IPTools::absoluteImpactParameter3D(), askFirstLayerHit_, Beamdxdz_, Beamsigmaz_, ecalDrivenElectronSeedsParameters_cff::beamSpot, reco::BeamSpot::BeamWidthX(), BeamWidthX_, reco::BeamSpot::BeamWidthY(), BeamWidthY_, BSx0_, BSy0_, BSz0_, TransientTrackBuilder::build(), reco::TrackBase::charge(), charge_, reco::Vertex::chi2(), reco::TrackBase::chi2(), chi2_, chi2ndof_, chi2normUnbiasedVertex_, chi2ProbUnbiasedVertex_, chi2UnbiasedVertex_, TrackClusterizerInZ::clusterize(), fastPrimaryVertexProducer_cfi::clusters, cmToum, allConversions_cfi::d0, reco::TrackBase::d0Error(), d3DErrorFromMyVertex_, d3DFromMyVertex_, debug_, TrackerGeometry::dets(), doBPix_, doFPix_, DOFUnbiasedVertex_, reco::BeamSpot::dxdz(), reco::TrackBase::dxy(), dxy_, dxyBs_, dxyErrorFromMyVertex_, dxyFromMyVertex_, reco::TrackBase::dz(), dz_, dzBs_, reco::TrackBase::dzError(), dzErrorFromMyVertex_, dzFromMyVertex_, PVValHelper::eta, reco::TrackBase::eta(), eta_, etaOfProbe_, edm::EventID::event(), edm::Event::eventAuxiliary(), EventNumber_, PVValHelper::fillByIndex(), fillTrackHistos(), forceBeamSpotContraint_, edm::EventSetup::get(), edm::Event::getByToken(), h2_probeEtaPhi_, h2_probeEtaPt_, h_Beamsigmaz, h_BeamWidthX, h_BeamWidthY, h_BSx0, h_BSy0, h_BSz0, h_dxy_Central_pT_, h_dxy_ladder_, h_dxy_ladderNoOverlap_, h_dxy_ladderOverlap_, h_dxy_modZ_, h_dxy_pT_, h_dz_Central_pT_, h_dz_ladder_, h_dz_modZ_, h_dz_pT_, h_etaMax, h_fitVtxChi2_, h_fitVtxChi2ndf_, h_fitVtxChi2Prob_, h_fitVtxNdof_, h_fitVtxNtracks_, h_fitVtxTrackAverageWeight_, h_fitVtxTrackWeights_, h_nbins, h_nClus, h_nLadders, h_nOfflineVertices, h_norm_dxy_Central_pT_, h_norm_dxy_ladder_, h_norm_dxy_modZ_, h_norm_dxy_pT_, h_norm_dz_Central_pT_, h_norm_dz_ladder_, h_norm_dz_modZ_, h_norm_dz_pT_, h_nTracks, h_probeCharge_, h_probeChi2_, h_probed0RefitV_, h_probed3DRefitV_, h_probedxyRecoV_, h_probedxyRefitV_, h_probedzRecoV_, h_probedzRefitV_, h_probeEta_, h_probeHasBPixL1Overlap_, h_probeHits1D_, h_probeHits2D_, h_probeHits_, h_probeHitsInBPIX_, h_probeHitsInFPIX_, h_probeHitsInTEC_, h_probeHitsInTIB_, h_probeHitsInTID_, h_probeHitsInTOB_, h_probeL1Ladder_, h_probeL1Module_, h_probeNormChi2_, h_probeP_, h_probePhi_, h_probePt_, h_probePtRebin_, h_probeQoverP_, h_probeRecoVSigXY_, h_probeRecoVSigZ_, h_probeRefitVLogSig3D_, h_probeRefitVSig3D_, h_probeRefitVSigResZ_, h_probeRefitVSigXY_, h_probeRefitVSigZ_, h_probereszRefitV_, h_probesignIP2DRefitV_, h_probez0RefitV_, h_pTinfo, h_recoVtxChi2ndf_, h_recoVtxChi2Prob_, h_recoVtxNtracks_, h_recoVtxSumPt_, h_runFromEvent, h_runNumber, h_xErrOfflineVertex, h_xOfflineVertex, h_yErrOfflineVertex, h_yOfflineVertex, h_zErrOfflineVertex, h_zOfflineVertex, hasFirstLayerPixelHits(), hasRecVertex_, hDA, reco::TrackBase::hitPattern(), hfClusterShapes_cfi::hits, mps_fire::i, edm::EventAuxiliary::id(), createfilelist::int, IP3DsigFromMyVertex_, IPLsigFromMyVertex_, IPTsigFromMyVertex_, isBFieldConsistentWithMode(), isGoodTrack_, isHighPurity_, isHit2D(), isPhase1_, TrackerGeometry::isThere(), reco::Vertex::isValid(), edm::HandleBase::isValid(), LogDebug, LogTrace, PerigeeTrajectoryParameters::longitudinalImpactParameter(), PerigeeTrajectoryError::longitudinalImpactParameterError(), edm::EventAuxiliary::luminosityBlock(), LuminosityBlockNumber_, M_PI, maxPt_, min(), minPt_, mypT_bins_, n_d3DEtaResiduals, n_d3DPhiResiduals, n_d3DResidualsMap, n_dxyBiasResidualsMap, n_dxyEtaBiasResiduals, n_dxyEtaResiduals, n_dxyPhiBiasResiduals, n_dxyPhiResiduals, n_dxyResidualsMap, n_dxyVsEta, n_dxyVsPhi, n_dzBiasResidualsMap, n_dzEtaBiasResiduals, n_dzEtaResiduals, n_dzPhiBiasResiduals, n_dzPhiResiduals, n_dzResidualsMap, n_dzVsEta, n_dzVsPhi, n_IP2DEtaResiduals, n_IP2DPhiResiduals, n_IP3DEtaResiduals, n_IP3DPhiResiduals, n_reszEtaResiduals, n_reszPhiResiduals, nBins_, nClus_, reco::Vertex::ndof(), Nevt_, nhits1D_, nhits2D_, nhits_, nhitsBPIX_, nhitsFPIX_, nHitsOfProbe_, nhitsTEC_, nhitsTIB_, nhitsTID_, nhitsTOB_, nLadders_, nMaxtracks_, nOfflineVertices_, reco::Vertex::normalizedChi2(), reco::TrackBase::normalizedChi2(), nPtBins_, vertices_cff::ntracks, nTracks_, nTracksPerClus_, reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidPixelBarrelHits(), reco::HitPattern::numberOfValidPixelEndcapHits(), reco::HitPattern::numberOfValidStripTECHits(), reco::HitPattern::numberOfValidStripTIBHits(), reco::HitPattern::numberOfValidStripTIDHits(), reco::HitPattern::numberOfValidStripTOBHits(), reco::TrackBase::p(), GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, p_, TrajectoryStateClosestToPoint::perigeeError(), TrajectoryStateClosestToPoint::perigeeParameters(), PVValHelper::phi, reco::TrackBase::phi(), phi_, PixelSubdetector::PixelBarrel, pixelHitsCheck(), pOfProbe_, point, FreeTrajectoryState::position(), TrajectoryStateClosestToPoint::position(), reco::Vertex::position(), position, funct::pow(), edm::ESHandle< T >::product(), EnergyCorrector::pt, reco::TrackBase::pt(), pt_, ptOfProbe_, MetAnalyzer::pv(), reco::TrackBase::px(), TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::TrackBase::qoverp(), qoverp_, reco::TrackBase::quality(), reco::Track::recHits(), rootTree_, edm::EventAuxiliary::run(), runControl_, runControlNumbers_, RunNumber_, TrackFilterForPVFindingBase::select(), reco::TransientTrack::setBeamSpot(), SetVarToZero(), PVValHelper::shrinkHistVectorToFit(), reco::BeamSpot::sigmaZ(), IPTools::signedImpactParameter3D(), IPTools::signedTransverseImpactParameter(), jetUpdater_cfi::sort, mathSSE::sqrt(), storeNtuple_, DetId::subdetId(), sumOfWeightsUnbiasedVertex_, funct::tan(), theBeamspotToken, theDetails_, TrajectoryStateClosestToPoint::theState(), reco::TrackBase::theta(), theta_, theTrackClusterizer_, theTrackCollectionToken, theTrackFilter_, theVertexCollectionToken, HiIsolationCommonParameters_cff::track, l1t::tracks, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), tracksUsedForVertexing_, PerigeeConversions::trajectoryStateClosestToPoint(), PerigeeTrajectoryParameters::transverseImpactParameter(), PVValHelper::histodetails::trendbins, groupFilesInBlocks::tt, useTracksFromRecoVtx_, reco::TrackBase::vertex(), vertexZMax_, electrons_cff::vertices, vtxSort(), cms::Exception::what(), wxy2_, x, PV3DBase< T, PVType, FrameType >::x(), reco::BeamSpot::x0(), xErrOfflineVertex_, xOfflineVertex_, xPCA_, xUnbiasedVertex_, y, PV3DBase< T, PVType, FrameType >::y(), reco::BeamSpot::y0(), yErrOfflineVertex_, yOfflineVertex_, yPCA_, yUnbiasedVertex_, z, reco::BeamSpot::z0(), zErrOfflineVertex_, zOfflineVertex_, zPCA_, zUnbiasedVertex_, and CombinatorialSeedGeneratorForCosmicsRegionalReconstruction_cfi::zVertex.

202 {
203 
204  using namespace std;
205  using namespace reco;
206  using namespace IPTools;
207 
208  if (!isBFieldConsistentWithMode(iSetup)) {
209  edm::LogWarning("PrimaryVertexValidation") << "*********************************************************************************\n"
210  << "* The configuration (ptOfProbe > " << ptOfProbe_ << "GeV) is not correctly set for current value of magnetic field \n"
211  << "* Switching it to 0. !!! \n"
212  << "*********************************************************************************"<< std::endl;
213  ptOfProbe_=0.;
214  }
215 
216  if(nBins_!=24 && debug_){
217  edm::LogInfo("PrimaryVertexValidation")<<"Using: "<<nBins_<<" bins plots";
218  }
219 
220  bool passesRunControl = false;
221 
222  if(runControl_){
223  for(const auto & runControlNumber : runControlNumbers_){
224  if(iEvent.eventAuxiliary().run() == runControlNumber){
225  if (debug_){
226  edm::LogInfo("PrimaryVertexValidation")<<" run number: "<<iEvent.eventAuxiliary().run()<<" keeping run:"<<runControlNumber;
227  }
228  passesRunControl = true;
229  break;
230  }
231  }
232  if (!passesRunControl) return;
233  }
234 
235  Nevt_++;
236 
237  //=======================================================
238  // Initialize Root-tuple variables
239  //=======================================================
240 
241  SetVarToZero();
242 
243  //=======================================================
244  // Retrieve the Magnetic Field information
245  //=======================================================
246 
247  edm::ESHandle<MagneticField> theMGField;
248  iSetup.get<IdealMagneticFieldRecord>().get( theMGField );
249 
250  //=======================================================
251  // Retrieve the Tracking Geometry information
252  //=======================================================
253 
254  edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
255  iSetup.get<GlobalTrackingGeometryRecord>().get( theTrackingGeometry );
256 
257  //=======================================================
258  // Retrieve geometry information
259  //=======================================================
260 
261  edm::LogInfo("read tracker geometry...");
263  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
264  edm::LogInfo("tracker geometry read")<<"There are: "<< pDD->dets().size() <<" detectors";
265 
266  // switch on the phase1
267  if( (pDD->isThere(GeomDetEnumerators::P1PXB)) ||
269  isPhase1_ = true;
270  nLadders_ = 12;
271 
272  if(h_dxy_ladderOverlap_.size()!=nLadders_){
273 
280 
281  if (debug_){
282  edm::LogInfo("PrimaryVertexValidation")<<"checking size:"<<h_dxy_ladder_.size()<<std::endl;
283  }
284  }
285 
286  if (debug_){
287  edm::LogInfo("PrimaryVertexValidation")<<" pixel phase1 setup, nLadders: "<<nLadders_;
288  }
289 
290  } else {
291  isPhase1_ = false;
292  nLadders_ = 20;
293  if (debug_){
294  edm::LogInfo("PrimaryVertexValidation")<<" pixel phase0 setup, nLadders: "<<nLadders_;
295  }
296  }
297 
298  if(isPhase1_){
300  } else {
302  }
303 
304  if(h_etaMax->GetEntries()==0.){
305  h_etaMax->SetBinContent(1.,etaOfProbe_);
306  h_nbins->SetBinContent(1.,nBins_);
307  h_nLadders->SetBinContent(1.,nLadders_);
308  h_pTinfo->SetBinContent(1.,mypT_bins_.size());
309  h_pTinfo->SetBinContent(2.,minPt_);
310  h_pTinfo->SetBinContent(3.,maxPt_);
311  }
312 
313  //=======================================================
314  // Retrieve the Transient Track Builder information
315  //=======================================================
316 
318  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB_);
319  double fBfield_=((*theB_).field()->inTesla(GlobalPoint(0.,0.,0.))).z();
320 
321  //=======================================================
322  // Retrieve the Track information
323  //=======================================================
324 
325  edm::Handle<TrackCollection> trackCollectionHandle;
326  iEvent.getByToken(theTrackCollectionToken, trackCollectionHandle);
327  if(!trackCollectionHandle.isValid()) return;
328  auto const & tracks = *trackCollectionHandle;
329 
330  //=======================================================
331  // Retrieve tracker topology from geometry
332  //=======================================================
333 
334  edm::ESHandle<TrackerTopology> tTopoHandle;
335  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
336  const TrackerTopology* const tTopo = tTopoHandle.product();
337 
338  //=======================================================
339  // Retrieve offline vartex information (only for reco)
340  //=======================================================
341 
342  //edm::Handle<VertexCollection> vertices;
344 
345  try {
346  iEvent.getByToken(theVertexCollectionToken, vertices);
347  } catch ( cms::Exception& er ) {
348  LogTrace("PrimaryVertexValidation")<<"caught std::exception "<<er.what()<<std::endl;
349  }
350 
351  std::vector<Vertex> vsorted = *(vertices);
352  // sort the vertices by number of tracks in descending order
353  // use chi2 as tiebreaker
354  std::sort( vsorted.begin(), vsorted.end(), PrimaryVertexValidation::vtxSort );
355 
356  // skip events with no PV, this should not happen
357 
358  if( vsorted.empty()) return;
359 
360  // skip events failing vertex cut
361  if( std::abs(vsorted[0].z()) > vertexZMax_ ) return;
362 
363  if ( vsorted[0].isValid() ) {
364  xOfflineVertex_ = (vsorted)[0].x();
365  yOfflineVertex_ = (vsorted)[0].y();
366  zOfflineVertex_ = (vsorted)[0].z();
367 
368  xErrOfflineVertex_ = (vsorted)[0].xError();
369  yErrOfflineVertex_ = (vsorted)[0].yError();
370  zErrOfflineVertex_ = (vsorted)[0].zError();
371  }
372 
379 
380  unsigned int vertexCollectionSize = vsorted.size();
381  int nvvertex = 0;
382 
383  for (unsigned int i=0; i<vertexCollectionSize; i++) {
384  const Vertex& vertex = vsorted.at(i);
385  if (vertex.isValid()) nvvertex++;
386  }
387 
388  nOfflineVertices_ = nvvertex;
389  h_nOfflineVertices->Fill(nvvertex);
390 
391  if ( !vsorted.empty() && useTracksFromRecoVtx_ ) {
392 
393  double sumpt = 0;
394  size_t ntracks = 0;
395  double chi2ndf = 0.;
396  double chi2prob = 0.;
397 
398  if (!vsorted.at(0).isFake()) {
399 
400  Vertex pv = vsorted.at(0);
401 
402  ntracks = pv.tracksSize();
403  chi2ndf = pv.normalizedChi2();
404  chi2prob = TMath::Prob(pv.chi2(),(int)pv.ndof());
405 
406  h_recoVtxNtracks_->Fill(ntracks);
407  h_recoVtxChi2ndf_->Fill(chi2ndf);
408  h_recoVtxChi2Prob_->Fill(chi2prob);
409 
410  for (Vertex::trackRef_iterator itrk = pv.tracks_begin();itrk != pv.tracks_end(); ++itrk) {
411  double pt = (**itrk).pt();
412  sumpt += pt*pt;
413 
414  const math::XYZPoint myVertex(pv.position().x(),pv.position().y(),pv.position().z());
415 
416  double dxyRes = (**itrk).dxy(myVertex);
417  double dzRes = (**itrk).dz(myVertex);
418 
419  double dxy_err = (**itrk).dxyError();
420  double dz_err = (**itrk).dzError();
421 
422  float trackphi = ((**itrk).phi())*(180/M_PI);
423  float tracketa = (**itrk).eta();
424 
425  for(int i=0; i<nBins_; i++){
426 
427  float phiF = theDetails_.trendbins[PVValHelper::phi][i];
428  float phiL = theDetails_.trendbins[PVValHelper::phi][i+1];
429 
430  float etaF = theDetails_.trendbins[PVValHelper::eta][i];
431  float etaL = theDetails_.trendbins[PVValHelper::eta][i+1];
432 
433  if(tracketa >= etaF && tracketa < etaL ){
434 
439 
440  }
441 
442  if(trackphi >= phiF && trackphi < phiL ){
443 
448 
449  for(int j=0; j<nBins_; j++){
450 
451  float etaJ = theDetails_.trendbins[PVValHelper::eta][j];
452  float etaK = theDetails_.trendbins[PVValHelper::eta][j+1];
453 
454  if(tracketa >= etaJ && tracketa < etaK ){
455 
456  a_dxyBiasResidualsMap[i][j]->Fill(dxyRes*cmToum);
457  a_dzBiasResidualsMap[i][j]->Fill(dzRes*cmToum);
458 
459  n_dxyBiasResidualsMap[i][j]->Fill((dxyRes)/dxy_err);
460  n_dzBiasResidualsMap[i][j]->Fill((dzRes)/dz_err);
461 
462  }
463  }
464  }
465  }
466  }
467 
468  h_recoVtxSumPt_->Fill(sumpt);
469 
470  }
471  }
472 
473  //=======================================================
474  // Retrieve Beamspot information
475  //=======================================================
476 
478  edm::Handle<BeamSpot> beamSpotHandle;
479  iEvent.getByToken(theBeamspotToken, beamSpotHandle);
480 
481  if ( beamSpotHandle.isValid() ) {
482  beamSpot = *beamSpotHandle;
483  BSx0_ = beamSpot.x0();
484  BSy0_ = beamSpot.y0();
485  BSz0_ = beamSpot.z0();
486  Beamsigmaz_ = beamSpot.sigmaZ();
487  Beamdxdz_ = beamSpot.dxdz();
488  BeamWidthX_ = beamSpot.BeamWidthX();
489  BeamWidthY_ = beamSpot.BeamWidthY();
490 
491  wxy2_=TMath::Power(BeamWidthX_,2)+TMath::Power(BeamWidthY_,2);
492 
493  } else {
494  edm::LogWarning("PrimaryVertexValidation")<<"No BeamSpot found!";
495  }
496 
497  h_BSx0->Fill(BSx0_);
498  h_BSy0->Fill(BSy0_);
499  h_BSz0->Fill(BSz0_);
500  h_Beamsigmaz->Fill(Beamsigmaz_);
501  h_BeamWidthX->Fill(BeamWidthX_);
502  h_BeamWidthY->Fill(BeamWidthY_);
503 
504  if(debug_)
505  edm::LogInfo("PrimaryVertexValidation")<<"Beamspot x:" <<BSx0_<<" y:"<<BSy0_<<" z:"<<BSz0_;
506 
507  //=======================================================
508  // Starts here ananlysis
509  //=======================================================
510 
511  RunNumber_=iEvent.eventAuxiliary().run();
512  h_runNumber->Fill(RunNumber_);
513 
514  if(h_runFromEvent->GetEntries()==0){
515  h_runFromEvent->SetBinContent(1,RunNumber_);
516  }
517 
519  EventNumber_=iEvent.eventAuxiliary().id().event();
520 
521  if(debug_)
522  edm::LogInfo("PrimaryVertexValidation")<<" looping over "<<trackCollectionHandle->size()<< "tracks";
523 
524  h_nTracks->Fill(trackCollectionHandle->size());
525 
526  //======================================================
527  // Interface RECO tracks to vertex reconstruction
528  //======================================================
529 
530  std::vector<TransientTrack> t_tks;
531  for (const auto & track : tracks){
532  TransientTrack tt = theB_->build(&(track));
533  tt.setBeamSpot(beamSpot);
534  t_tks.push_back(tt);
535 
536  }
537 
538  if(debug_) {
539  edm::LogInfo("PrimaryVertexValidation") << "Found: " << t_tks.size() << " reconstructed tracks";
540  }
541 
542  //======================================================
543  // select the tracks
544  //======================================================
545 
546  std::vector<TransientTrack> seltks = theTrackFilter_->select(t_tks);
547 
548  //======================================================
549  // clusterize tracks in Z
550  //======================================================
551 
552  vector< vector<TransientTrack> > clusters = theTrackClusterizer_->clusterize(seltks);
553 
554  if (debug_){
555  edm::LogInfo("PrimaryVertexValidation")<<" looping over: "<< clusters.size() << " clusters from " << t_tks.size() << " selected tracks";
556  }
557 
558  nClus_=clusters.size();
559  h_nClus->Fill(nClus_);
560 
561  //======================================================
562  // Starts loop on clusters
563  //======================================================
564  for (const auto & iclus : clusters){
565 
566  nTracksPerClus_=0;
567 
568  unsigned int i=0;
569  for(const auto & theTTrack : iclus)
570  {
571  i++;
572 
573  if ( nTracks_ >= nMaxtracks_ ) {
574  edm::LogError("PrimaryVertexValidation")<<" Warning - Number of tracks: " << nTracks_ << " , greater than " << nMaxtracks_;
575  continue;
576  }
577 
578  const Track & theTrack = theTTrack.track();
579 
580  pt_[nTracks_] = theTrack.pt();
581  p_[nTracks_] = theTrack.p();
582  nhits_[nTracks_] = theTrack.numberOfValidHits();
583  eta_[nTracks_] = theTrack.eta();
584  theta_[nTracks_] = theTrack.theta();
585  phi_[nTracks_] = theTrack.phi();
586  chi2_[nTracks_] = theTrack.chi2();
587  chi2ndof_[nTracks_] = theTrack.normalizedChi2();
588  charge_[nTracks_] = theTrack.charge();
589  qoverp_[nTracks_] = theTrack.qoverp();
590  dz_[nTracks_] = theTrack.dz();
591  dxy_[nTracks_] = theTrack.dxy();
592 
593  TrackBase::TrackQuality _trackQuality = TrackBase::qualityByName("highPurity");
594  isHighPurity_[nTracks_] = theTrack.quality(_trackQuality);
595 
597  dxyBs_[nTracks_] = theTrack.dxy(point);
598  dzBs_[nTracks_] = theTrack.dz(point);
599 
600  xPCA_[nTracks_] = theTrack.vertex().x();
601  yPCA_[nTracks_] = theTrack.vertex().y();
602  zPCA_[nTracks_] = theTrack.vertex().z();
603 
604  //=======================================================
605  // Retrieve rechit information
606  //=======================================================
607 
608  const reco::HitPattern& hits = theTrack.hitPattern();
609 
610  int nRecHit1D=0;
611  int nRecHit2D=0;
612  int nhitinTIB = hits.numberOfValidStripTIBHits();
613  int nhitinTOB = hits.numberOfValidStripTOBHits();
614  int nhitinTID = hits.numberOfValidStripTIDHits();
615  int nhitinTEC = hits.numberOfValidStripTECHits();
616  int nhitinBPIX = hits.numberOfValidPixelBarrelHits();
617  int nhitinFPIX = hits.numberOfValidPixelEndcapHits();
618  for (trackingRecHit_iterator iHit = theTTrack.recHitsBegin(); iHit != theTTrack.recHitsEnd(); ++iHit) {
619  if((*iHit)->isValid()) {
620 
621  if (this->isHit2D(**iHit)) {++nRecHit2D;}
622  else {++nRecHit1D; }
623  }
624  }
625 
626  nhits1D_[nTracks_] = nRecHit1D;
627  nhits2D_[nTracks_] = nRecHit2D;
628  nhitsBPIX_[nTracks_] = nhitinBPIX;
629  nhitsFPIX_[nTracks_] = nhitinFPIX;
630  nhitsTIB_[nTracks_] = nhitinTIB;
631  nhitsTID_[nTracks_] = nhitinTID;
632  nhitsTOB_[nTracks_] = nhitinTOB;
633  nhitsTEC_[nTracks_] = nhitinTEC;
634 
635  //=======================================================
636  // Good tracks for vertexing selection
637  //=======================================================
638 
639  bool pass = true;
640  if(askFirstLayerHit_) pass = this->hasFirstLayerPixelHits(theTTrack);
641  if (pass
642  && (theTrack.pt() >=ptOfProbe_)
643  && std::abs(theTrack.eta()) <= etaOfProbe_
644  && (theTrack.numberOfValidHits())>=nHitsOfProbe_
645  && (theTrack.p()) >= pOfProbe_ ){
647  }
648 
649  //=======================================================
650  // Fit unbiased vertex
651  //=======================================================
652 
653  vector<TransientTrack> theFinalTracks;
654  theFinalTracks.clear();
655 
656  for (const auto & tk : iclus) {
657 
658  pass = this->hasFirstLayerPixelHits(tk);
659  if (pass){
660  if( tk == theTTrack ) continue;
661  else {
662  theFinalTracks.push_back(tk);
663  }
664  }
665  }
666 
667  if(theFinalTracks.size() > 1){
668 
669  if(debug_)
670  edm::LogInfo("PrimaryVertexValidation")<<"Transient Track Collection size: "<<theFinalTracks.size();
671  try{
672 
673  //AdaptiveVertexFitter* theFitter = new AdaptiveVertexFitter;
674  auto theFitter = std::unique_ptr<VertexFitter<5> >( new AdaptiveVertexFitter());
675  TransientVertex theFittedVertex;
676 
678  theFittedVertex = theFitter->vertex(theFinalTracks,beamSpot); // if you want the beam constraint
679  } else {
680  theFittedVertex = theFitter->vertex(theFinalTracks);
681  }
682 
683 
684 
685  double totalTrackWeights=0;
686  if(theFittedVertex.isValid ()){
687 
688 
689  if(theFittedVertex.hasTrackWeight()){
690  for(const auto & theFinalTrack : theFinalTracks){
691  sumOfWeightsUnbiasedVertex_[nTracks_] += theFittedVertex.trackWeight(theFinalTrack);
692  totalTrackWeights+= theFittedVertex.trackWeight(theFinalTrack);
693  h_fitVtxTrackWeights_->Fill(theFittedVertex.trackWeight(theFinalTrack));
694  }
695  }
696 
697  h_fitVtxTrackAverageWeight_->Fill(totalTrackWeights/theFinalTracks.size());
698 
700  const math::XYZPoint myVertex(theFittedVertex.position().x(),theFittedVertex.position().y(),theFittedVertex.position().z());
701 
702  const Vertex vertex = theFittedVertex;
703  fillTrackHistos(hDA,"all",&theTTrack,vertex,beamSpot,fBfield_);
704 
705  hasRecVertex_[nTracks_] = 1;
706  xUnbiasedVertex_[nTracks_] = theFittedVertex.position().x();
707  yUnbiasedVertex_[nTracks_] = theFittedVertex.position().y();
708  zUnbiasedVertex_[nTracks_] = theFittedVertex.position().z();
709 
710  chi2normUnbiasedVertex_[nTracks_] = theFittedVertex.normalisedChiSquared();
711  chi2UnbiasedVertex_[nTracks_] = theFittedVertex.totalChiSquared();
712  DOFUnbiasedVertex_[nTracks_] = theFittedVertex.degreesOfFreedom();
713  chi2ProbUnbiasedVertex_[nTracks_] = TMath::Prob(theFittedVertex.totalChiSquared(),(int)theFittedVertex.degreesOfFreedom());
714  tracksUsedForVertexing_[nTracks_] = theFinalTracks.size();
715 
716  h_fitVtxNtracks_->Fill(theFinalTracks.size());
717  h_fitVtxChi2_->Fill(theFittedVertex.totalChiSquared());
718  h_fitVtxNdof_->Fill(theFittedVertex.degreesOfFreedom());
719  h_fitVtxChi2ndf_->Fill(theFittedVertex.normalisedChiSquared());
720  h_fitVtxChi2Prob_->Fill(TMath::Prob(theFittedVertex.totalChiSquared(),(int)theFittedVertex.degreesOfFreedom()));
721 
722  // from my Vertex
723  double dxyFromMyVertex = theTrack.dxy(myVertex);
724  double dzFromMyVertex = theTrack.dz(myVertex);
725 
726  GlobalPoint vert(theFittedVertex.position().x(),theFittedVertex.position().y(),theFittedVertex.position().z());
727 
728  //FreeTrajectoryState theTrackNearVertex = theTTrack.trajectoryStateClosestToPoint(vert).theState();
729  //double dz_err = sqrt(theFittedVertex.positionError().czz() + theTrackNearVertex.cartesianError().position().czz());
730  //double dz_err = hypot(theTrack.dzError(),theFittedVertex.positionError().czz());
731 
732  double dz_err = sqrt(std::pow(theTrack.dzError(), 2) + theFittedVertex.positionError().czz());
733 
734 
735  // PV2D
736  std::pair<bool,Measurement1D> s_ip2dpv = signedTransverseImpactParameter(theTTrack,
737  GlobalVector(theTrack.px(),
738  theTrack.py(),
739  theTrack.pz()),
740  theFittedVertex);
741 
742  double s_ip2dpv_corr = s_ip2dpv.second.value();
743  double s_ip2dpv_err = s_ip2dpv.second.error();
744 
745  // PV3D
746  std::pair<bool, Measurement1D> s_ip3dpv = signedImpactParameter3D(theTTrack,
747  GlobalVector(theTrack.px(),
748  theTrack.py(),
749  theTrack.pz()),
750  theFittedVertex);
751 
752  double s_ip3dpv_corr = s_ip3dpv.second.value();
753  double s_ip3dpv_err = s_ip3dpv.second.error();
754 
755  // PV3D absolute
756  std::pair<bool,Measurement1D> ip3dpv = absoluteImpactParameter3D(theTTrack,theFittedVertex);
757  double ip3d_corr = ip3dpv.second.value();
758  double ip3d_err = ip3dpv.second.error();
759 
760  // with respect to any specified vertex, such as primary vertex
762 
763  GlobalPoint refPoint = traj.position();
764  GlobalPoint cPToVtx = traj.theState().position();
765 
766  float my_dx = refPoint.x() - myVertex.x();
767  float my_dy = refPoint.y() - myVertex.y();
768 
769  float my_dx2 = cPToVtx.x() - myVertex.x();
770  float my_dy2 = cPToVtx.y() - myVertex.y();
771 
772  float my_dxy = std::sqrt(my_dx*my_dx + my_dy*my_dy);
773 
775  //double d0_error = traj.perigeeError().transverseImpactParameterError();
776  double z0 = traj.perigeeParameters().longitudinalImpactParameter();
777  double z0_error = traj.perigeeError().longitudinalImpactParameterError();
778 
779  if(debug_){
780  edm::LogInfo("PrimaryVertexValidation")<< "my_dx:" << my_dx
781  << " my_dy:" << my_dy
782  << " my_dxy:" << my_dxy
783  << " my_dx2:" << my_dx2
784  << " my_dy2:" << my_dy2
785  << " d0: " << d0
786  << " dxyFromVtx:" << dxyFromMyVertex << "\n"
787  << " ============================== "<< "\n"
788  << "diff1:" << std::abs(d0) - std::abs(my_dxy) << "\n"
789  << "diff2:" << std::abs(d0) - std::abs(dxyFromMyVertex) << "\n"
790  << "diff3:" << (my_dx - my_dx2) << " " << (my_dy - my_dy2) << "\n"
791  << std::endl;
792  }
793 
794  // define IPs
795 
796  dxyFromMyVertex_[nTracks_] = dxyFromMyVertex;
797  dxyErrorFromMyVertex_[nTracks_] = s_ip2dpv_err;
798  IPTsigFromMyVertex_[nTracks_] = dxyFromMyVertex/s_ip2dpv_err;
799 
800  dzFromMyVertex_[nTracks_] = dzFromMyVertex;
801  dzErrorFromMyVertex_[nTracks_] = dz_err;
802  IPLsigFromMyVertex_[nTracks_] = dzFromMyVertex/dz_err;
803 
804  d3DFromMyVertex_[nTracks_] = ip3d_corr;
805  d3DErrorFromMyVertex_[nTracks_] = ip3d_err;
806  IP3DsigFromMyVertex_[nTracks_] = (ip3d_corr/ip3d_err);
807 
808  // fill directly the histograms of residuals
809 
810  float trackphi = (theTrack.phi())*(180./M_PI);
811  float tracketa = theTrack.eta();
812  float trackpt = theTrack.pt();
813  float trackp = theTrack.p();
814  float tracknhits = theTrack.numberOfValidHits();
815 
816  // determine the module number and ladder
817 
818  int ladder_num = -1.;
819  int module_num = -1.;
820  int L1BPixHitCount = 0;
821 
822  for(auto const& hit : theTrack.recHits()) {
823  const DetId& detId = hit->geographicalId();
824  unsigned int subid = detId.subdetId();
825 
826  if(hit->isValid() && ( subid == PixelSubdetector::PixelBarrel ) ) {
827  int layer = tTopo->pxbLayer(detId);
828  if(layer==1){
829  L1BPixHitCount+=1;
830  ladder_num = tTopo->pxbLadder(detId);
831  module_num = tTopo->pxbModule(detId);
832  }
833  }
834  }
835 
836  h_probeL1Ladder_->Fill(ladder_num);
837  h_probeL1Module_->Fill(module_num);
838  h_probeHasBPixL1Overlap_->Fill(L1BPixHitCount);
839 
840  // filling the pT-binned distributions
841 
842  for(int ipTBin=0; ipTBin<nPtBins_; ipTBin++){
843 
844  float pTF = mypT_bins_[ipTBin];
845  float pTL = mypT_bins_[ipTBin+1];
846 
847  if(debug_)
848  edm::LogInfo("PrimaryVertexValidation")<<"ipTBin:"<<ipTBin<< " "<<mypT_bins_[ipTBin]<< " < pT < "<<mypT_bins_[ipTBin+1]<<std::endl;
849 
850  if( std::abs(tracketa)<1.5 && (trackpt >= pTF && trackpt < pTL) ){
851 
852  if(debug_)
853  edm::LogInfo("PrimaryVertexValidation")<<"passes this cut: "<<mypT_bins_[ipTBin]<<std::endl;
854  PVValHelper::fillByIndex(h_dxy_pT_,ipTBin,dxyFromMyVertex*cmToum);
855  PVValHelper::fillByIndex(h_dz_pT_,ipTBin,dzFromMyVertex*cmToum);
856  PVValHelper::fillByIndex(h_norm_dxy_pT_,ipTBin,dxyFromMyVertex/s_ip2dpv_err);
857  PVValHelper::fillByIndex(h_norm_dz_pT_,ipTBin,dzFromMyVertex/dz_err);
858 
859  if(std::abs(tracketa)<1.){
860 
861  if(debug_)
862  edm::LogInfo("PrimaryVertexValidation")<<"passes tight eta cut: "<<mypT_bins_[ipTBin]<<std::endl;
863  PVValHelper::fillByIndex(h_dxy_Central_pT_,ipTBin,dxyFromMyVertex*cmToum);
864  PVValHelper::fillByIndex(h_dz_Central_pT_,ipTBin,dzFromMyVertex*cmToum);
865  PVValHelper::fillByIndex(h_norm_dxy_Central_pT_,ipTBin,dxyFromMyVertex/s_ip2dpv_err);
866  PVValHelper::fillByIndex(h_norm_dz_Central_pT_,ipTBin,dzFromMyVertex/dz_err);
867  }
868  }
869  }
870 
871  // checks on the probe track quality
872  if(trackpt >= ptOfProbe_
873  && std::abs(tracketa)<= etaOfProbe_
874  && tracknhits>=nHitsOfProbe_
875  && trackp >= pOfProbe_){
876 
877  std::pair<bool,bool> pixelOcc = pixelHitsCheck((theTTrack));
878 
879  if(debug_){
880  if(pixelOcc.first == true)
881  edm::LogInfo("PrimaryVertexValidation")<<"has BPIx hits"<<std::endl;
882  if(pixelOcc.second == true)
883  edm::LogInfo("PrimaryVertexValidation")<<"has FPix hits"<<std::endl;
884  }
885 
886  if(!doBPix_ && (pixelOcc.first == true)) continue;
887  if(!doFPix_ && (pixelOcc.second == true)) continue;
888 
889  fillTrackHistos(hDA,"sel",&(theTTrack),vertex,beamSpot,fBfield_);
890 
891  // probe checks
892  h_probePt_->Fill(theTrack.pt());
893  h_probePtRebin_->Fill(theTrack.pt());
894  h_probeP_->Fill(theTrack.p());
895  h_probeEta_->Fill(theTrack.eta());
896  h_probePhi_->Fill(theTrack.phi());
897  h2_probeEtaPhi_->Fill(theTrack.eta(),theTrack.phi());
898  h2_probeEtaPt_->Fill(theTrack.eta(),theTrack.pt());
899 
900  h_probeChi2_->Fill(theTrack.chi2());
901  h_probeNormChi2_->Fill(theTrack.normalizedChi2());
902  h_probeCharge_->Fill(theTrack.charge());
903  h_probeQoverP_->Fill(theTrack.qoverp());
904  h_probeHits_->Fill(theTrack.numberOfValidHits());
905  h_probeHits1D_->Fill(nRecHit1D);
906  h_probeHits2D_->Fill(nRecHit2D);
907  h_probeHitsInTIB_->Fill(nhitinBPIX);
908  h_probeHitsInTOB_->Fill(nhitinFPIX);
909  h_probeHitsInTID_->Fill(nhitinTIB);
910  h_probeHitsInTEC_->Fill(nhitinTID);
911  h_probeHitsInBPIX_->Fill(nhitinTOB);
912  h_probeHitsInFPIX_->Fill(nhitinTEC);
913 
914  float dxyRecoV = theTrack.dz(theRecoVertex);
915  float dzRecoV = theTrack.dxy(theRecoVertex);
916  float dxysigmaRecoV = TMath::Sqrt(theTrack.d0Error()*theTrack.d0Error()+xErrOfflineVertex_*yErrOfflineVertex_);
917  float dzsigmaRecoV = TMath::Sqrt(theTrack.dzError()*theTrack.dzError()+zErrOfflineVertex_*zErrOfflineVertex_);
918 
919  double zTrack=(theTTrack.stateAtBeamLine().trackStateAtPCA()).position().z();
920  double zVertex=theFittedVertex.position().z();
921  double tantheta=tan((theTTrack.stateAtBeamLine().trackStateAtPCA()).momentum().theta());
922 
923  double dz2= pow(theTrack.dzError(),2)+wxy2_/pow(tantheta,2);
924  double restrkz = zTrack-zVertex;
925  double pulltrkz = (zTrack-zVertex)/TMath::Sqrt(dz2);
926 
927  h_probedxyRecoV_->Fill(dxyRecoV);
928  h_probedzRecoV_->Fill(dzRecoV);
929 
930  h_probedzRefitV_->Fill(dxyFromMyVertex);
931  h_probedxyRefitV_->Fill(dzFromMyVertex);
932 
933  h_probed0RefitV_->Fill(d0);
934  h_probez0RefitV_->Fill(z0);
935 
936  h_probesignIP2DRefitV_->Fill(s_ip2dpv_corr);
937  h_probed3DRefitV_->Fill(ip3d_corr);
938  h_probereszRefitV_->Fill(restrkz);
939 
940  h_probeRecoVSigZ_->Fill(dzRecoV/dzsigmaRecoV);
941  h_probeRecoVSigXY_->Fill(dxyRecoV/dxysigmaRecoV);
942  h_probeRefitVSigZ_->Fill(dzFromMyVertex/dz_err);
943  h_probeRefitVSigXY_->Fill(dxyFromMyVertex/s_ip2dpv_err);
944  h_probeRefitVSig3D_->Fill(ip3d_corr/ip3d_err);
945  h_probeRefitVLogSig3D_->Fill(log10(ip3d_corr/ip3d_err));
946  h_probeRefitVSigResZ_->Fill(pulltrkz);
947 
948  a_dxyVsPhi->Fill(trackphi,dxyFromMyVertex*cmToum);
949  a_dzVsPhi->Fill(trackphi,z0*cmToum);
950  n_dxyVsPhi->Fill(trackphi,dxyFromMyVertex/s_ip2dpv_err);
951  n_dzVsPhi->Fill(trackphi,z0/z0_error);
952 
953  a_dxyVsEta->Fill(tracketa,dxyFromMyVertex*cmToum);
954  a_dzVsEta->Fill(tracketa,z0*cmToum);
955  n_dxyVsEta->Fill(tracketa,dxyFromMyVertex/s_ip2dpv_err);
956  n_dzVsEta->Fill(tracketa,z0/z0_error);
957 
958  if( ladder_num > 0 && module_num > 0 ) {
959 
960  LogDebug("PrimaryVertexValidation")<<" ladder_num"<<ladder_num <<" module_num"<<module_num <<std::endl;
961 
962  PVValHelper::fillByIndex(h_dxy_modZ_,module_num-1,dxyFromMyVertex*cmToum);
963  PVValHelper::fillByIndex(h_dz_modZ_,module_num-1,dzFromMyVertex*cmToum);
964  PVValHelper::fillByIndex(h_norm_dxy_modZ_,module_num-1,dxyFromMyVertex/s_ip2dpv_err);
965  PVValHelper::fillByIndex(h_norm_dz_modZ_,module_num-1,dzFromMyVertex/dz_err);
966 
967  PVValHelper::fillByIndex(h_dxy_ladder_,ladder_num-1,dxyFromMyVertex*cmToum);
968 
969  LogDebug("PrimaryVertexValidation")<<"h_dxy_ladder size:" <<h_dxy_ladder_.size() << std::endl;
970 
971  if(L1BPixHitCount==1){
972  PVValHelper::fillByIndex(h_dxy_ladderNoOverlap_,ladder_num-1,dxyFromMyVertex*cmToum);
973  } else {
974  PVValHelper::fillByIndex(h_dxy_ladderOverlap_,ladder_num-1,dxyFromMyVertex*cmToum);
975  }
976 
977  PVValHelper::fillByIndex(h_dz_ladder_,ladder_num-1,dzFromMyVertex*cmToum);
978  PVValHelper::fillByIndex(h_norm_dxy_ladder_,ladder_num-1,dxyFromMyVertex/s_ip2dpv_err);
979  PVValHelper::fillByIndex(h_norm_dz_ladder_,ladder_num-1,dzFromMyVertex/dz_err);
980 
981  }
982 
983  // filling the binned distributions
984  for(int i=0; i<nBins_; i++){
985 
986  float phiF = theDetails_.trendbins[PVValHelper::phi][i];
987  float phiL = theDetails_.trendbins[PVValHelper::phi][i+1];
988 
989  float etaF = theDetails_.trendbins[PVValHelper::eta][i];
990  float etaL = theDetails_.trendbins[PVValHelper::eta][i+1];
991 
992  if(tracketa >= etaF && tracketa < etaL ){
993 
994  PVValHelper::fillByIndex(a_dxyEtaResiduals,i,dxyFromMyVertex*cmToum,"1");
995  PVValHelper::fillByIndex(a_dxEtaResiduals,i,my_dx*cmToum,"2");
996  PVValHelper::fillByIndex(a_dyEtaResiduals,i,my_dy*cmToum,"3");
997  PVValHelper::fillByIndex(a_dzEtaResiduals,i,dzFromMyVertex*cmToum,"4");
998  PVValHelper::fillByIndex(n_dxyEtaResiduals,i,dxyFromMyVertex/s_ip2dpv_err,"5");
999  PVValHelper::fillByIndex(n_dzEtaResiduals,i,dzFromMyVertex/dz_err,"6");
1000  PVValHelper::fillByIndex(a_IP2DEtaResiduals,i,s_ip2dpv_corr*cmToum,"7");
1001  PVValHelper::fillByIndex(n_IP2DEtaResiduals,i,s_ip2dpv_corr/s_ip2dpv_err,"8");
1002  PVValHelper::fillByIndex(a_reszEtaResiduals,i,restrkz*cmToum,"9");
1004  PVValHelper::fillByIndex(a_d3DEtaResiduals,i,ip3d_corr*cmToum,"11");
1005  PVValHelper::fillByIndex(n_d3DEtaResiduals,i,ip3d_corr/ip3d_err,"12");
1006  PVValHelper::fillByIndex(a_IP3DEtaResiduals,i,s_ip3dpv_corr*cmToum,"13");
1007  PVValHelper::fillByIndex(n_IP3DEtaResiduals,i,s_ip3dpv_corr/s_ip3dpv_err,"14");
1008 
1009  }
1010 
1011  if(trackphi >= phiF && trackphi < phiL ){
1012 
1013  PVValHelper::fillByIndex(a_dxyPhiResiduals,i,dxyFromMyVertex*cmToum,"15");
1014  PVValHelper::fillByIndex(a_dxPhiResiduals,i,my_dx*cmToum,"16");
1015  PVValHelper::fillByIndex(a_dyPhiResiduals,i,my_dy*cmToum,"17");
1016  PVValHelper::fillByIndex(a_dzPhiResiduals,i,dzFromMyVertex*cmToum,"18");
1017  PVValHelper::fillByIndex(n_dxyPhiResiduals,i,dxyFromMyVertex/s_ip2dpv_err,"19");
1018  PVValHelper::fillByIndex(n_dzPhiResiduals,i,dzFromMyVertex/dz_err,"20");
1019  PVValHelper::fillByIndex(a_IP2DPhiResiduals,i,s_ip2dpv_corr*cmToum,"21");
1020  PVValHelper::fillByIndex(n_IP2DPhiResiduals,i,s_ip2dpv_corr/s_ip2dpv_err,"22");
1021  PVValHelper::fillByIndex(a_reszPhiResiduals,i,restrkz*cmToum,"23");
1023  PVValHelper::fillByIndex(a_d3DPhiResiduals,i,ip3d_corr*cmToum,"25");
1024  PVValHelper::fillByIndex(n_d3DPhiResiduals,i,ip3d_corr/ip3d_err,"26");
1025  PVValHelper::fillByIndex(a_IP3DPhiResiduals,i,s_ip3dpv_corr*cmToum,"27");
1026  PVValHelper::fillByIndex(n_IP3DPhiResiduals,i,s_ip3dpv_corr/s_ip3dpv_err,"28");
1027 
1028  for(int j=0; j<nBins_; j++){
1029 
1030  float etaJ = theDetails_.trendbins[PVValHelper::eta][j];
1031  float etaK = theDetails_.trendbins[PVValHelper::eta][j+1];
1032 
1033  if(tracketa >= etaJ && tracketa < etaK ){
1034  a_dxyResidualsMap[i][j]->Fill(dxyFromMyVertex*cmToum);
1035  a_dzResidualsMap[i][j]->Fill(dzFromMyVertex*cmToum);
1036  n_dxyResidualsMap[i][j]->Fill(dxyFromMyVertex/s_ip2dpv_err);
1037  n_dzResidualsMap[i][j]->Fill(dzFromMyVertex/dz_err);
1038  a_d3DResidualsMap[i][j]->Fill(ip3d_corr*cmToum);
1039  n_d3DResidualsMap[i][j]->Fill(ip3d_corr/ip3d_err);
1040 
1041  }
1042  }
1043  }
1044  }
1045  }
1046 
1047  if(debug_){
1048  edm::LogInfo("PrimaryVertexValidation")<<" myVertex.x()= "<<myVertex.x()<<"\n"
1049  <<" myVertex.y()= "<<myVertex.y()<<" \n"
1050  <<" myVertex.z()= "<<myVertex.z()<<" \n"
1051  <<" theTrack.dz(myVertex)= "<<theTrack.dz(myVertex)<<" \n"
1052  <<" zPCA -myVertex.z() = "<<(theTrack.vertex().z() -myVertex.z());
1053 
1054  }// ends if debug_
1055  } // ends if the fitted vertex is Valid
1056 
1057  //delete theFitter;
1058 
1059  } catch ( cms::Exception& er ) {
1060  LogTrace("PrimaryVertexValidation")<<"caught std::exception "<<er.what()<<std::endl;
1061  }
1062 
1063  } //ends if theFinalTracks.size() > 2
1064 
1065  else {
1066  if(debug_)
1067  edm::LogInfo("PrimaryVertexValidation")<<"Not enough tracks to make a vertex. Returns no vertex info";
1068  }
1069 
1070  ++nTracks_;
1071  ++nTracksPerClus_;
1072 
1073  if(debug_)
1074  edm::LogInfo("PrimaryVertexValidation")<<"Track "<<i<<" : pT = "<<theTrack.pt();
1075 
1076  }// for loop on tracks
1077  } // for loop on track clusters
1078 
1079  // Fill the TTree if needed
1080 
1081  if(storeNtuple_){
1082  rootTree_->Fill();
1083  }
1084 
1085 
1086 }
#define LogDebug(id)
std::vector< TH1F * > h_norm_dxy_modZ_
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const AlgebraicVector3 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const AlgebraicSymMatrix66 &theCovarianceMatrix, const MagneticField *field)
double qoverp() const
q / p
Definition: TrackBase.h:612
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
EventNumber_t event() const
Definition: EventID.h:41
double z0() const
z coordinate
Definition: BeamSpot.h:68
std::vector< TH1F * > n_IP3DPhiResiduals
std::vector< TH1F * > a_dxyEtaResiduals
TH1F * n_dzResidualsMap[nMaxBins_][nMaxBins_]
std::vector< TH1F * > a_d3DEtaResiduals
double d0Error() const
error on d0
Definition: TrackBase.h:853
double longitudinalImpactParameterError() const
std::vector< TH1F * > n_reszPhiResiduals
std::vector< unsigned int > runControlNumbers_
EventAuxiliary const & eventAuxiliary() const override
Definition: Event.h:92
void fillByIndex(std::vector< TH1F * > &h, unsigned int index, double x, std::string tag="")
static bool vtxSort(const reco::Vertex &a, const reco::Vertex &b)
const PerigeeTrajectoryError & perigeeError() const
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:81
void setBeamSpot(const reco::BeamSpot &beamSpot)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:600
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< TH1F * > h_dxy_pT_
TrackFilterForPVFindingBase * theTrackFilter_
TH1F * a_dxyResidualsMap[nMaxBins_][nMaxBins_]
std::map< std::string, TH1 * > hDA
TrackQuality
track quality
Definition: TrackBase.h:151
std::vector< TH1F * > a_IP3DEtaResiduals
const FreeTrajectoryState & theState() const
double theta() const
polar angle
Definition: TrackBase.h:618
std::vector< TH1F * > n_dzPhiResiduals
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:68
std::vector< TH1F * > a_d3DPhiResiduals
std::vector< TH1F * > n_d3DPhiResiduals
std::vector< TH1F * > n_dxyPhiBiasResiduals
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
TH1F * n_dxyBiasResidualsMap[nMaxBins_][nMaxBins_]
std::vector< TH1F * > n_d3DEtaResiduals
unsigned int pxbLadder(const DetId &id) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
reco::TransientTrack build(const reco::Track *p) const
std::vector< TH1F * > h_norm_dz_Central_pT_
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
T y() const
Definition: PV3DBase.h:63
RunNumber_t run() const
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:684
float DOFUnbiasedVertex_[nMaxtracks_]
unsigned int pxbModule(const DetId &id) const
double d3DFromMyVertex_[nMaxtracks_]
char const * what() const override
Definition: Exception.cc:103
std::vector< TH1F * > a_reszPhiResiduals
std::vector< TH1F * > a_IP2DPhiResiduals
float chi2ProbUnbiasedVertex_[nMaxtracks_]
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:666
std::vector< TH1F * > n_reszEtaResiduals
double dxyFromMyVertex_[nMaxtracks_]
const Point & position() const
position
Definition: Vertex.h:109
std::vector< TH1F * > h_dz_modZ_
std::vector< TH1F * > h_dxy_modZ_
std::vector< TH1F * > a_dxEtaResiduals
bool isBFieldConsistentWithMode(const edm::EventSetup &iSetup) const
std::pair< bool, bool > pixelHitsCheck(const reco::TransientTrack &track)
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:946
double dzErrorFromMyVertex_[nMaxtracks_]
std::vector< TH1F * > n_dxyEtaBiasResiduals
void fillTrackHistos(std::map< std::string, TH1 * > &h, const std::string &ttype, const reco::TransientTrack *tt, const reco::Vertex &v, const reco::BeamSpot &beamSpot, double fBfield)
LuminosityBlockNumber_t luminosityBlock() const
std::vector< TH1F * > n_dxyEtaResiduals
double IPTsigFromMyVertex_[nMaxtracks_]
bool isThere(GeomDetEnumerators::SubDetector subdet) const
std::vector< TH1F * > a_dzPhiBiasResiduals
std::vector< TH1F * > h_norm_dxy_pT_
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::vector< TH1F * > a_dzEtaResiduals
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:738
int tracksUsedForVertexing_[nMaxtracks_]
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
std::vector< TH1F * > a_dxyEtaBiasResiduals
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:921
std::vector< TH1F * > h_norm_dxy_ladder_
const PerigeeTrajectoryParameters & perigeeParameters() const
std::vector< TH1F * > a_dzPhiResiduals
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:588
double yUnbiasedVertex_[nMaxtracks_]
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:660
std::vector< TH1F * > n_dxyPhiResiduals
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::map< plotVariable, std::vector< float > > trendbins
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
auto recHits() const
Access to reconstructed hits on the track.
Definition: Track.h:106
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double chi2() const
chi-squares
Definition: Vertex.h:98
double zUnbiasedVertex_[nMaxtracks_]
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:941
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
std::vector< TH1F * > h_dxy_ladder_
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:901
int numberOfValidStripTECHits() const
Definition: HitPattern.h:951
float chi2normUnbiasedVertex_[nMaxtracks_]
TH1F * n_d3DResidualsMap[nMaxBins_][nMaxBins_]
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< TH1F * > a_dxyPhiResiduals
std::vector< TH1F * > a_dxyPhiBiasResiduals
edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionToken
TH1F * a_d3DResidualsMap[nMaxBins_][nMaxBins_]
std::vector< TH1F * > h_dxy_ladderNoOverlap_
bool isValid() const
Definition: HandleBase.h:74
double IPLsigFromMyVertex_[nMaxtracks_]
#define LogTrace(id)
bool hasFirstLayerPixelHits(const reco::TransientTrack &track)
std::vector< TH1F * > n_dzEtaResiduals
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
double ndof() const
Definition: Vertex.h:105
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
std::vector< TH1F * > n_IP3DEtaResiduals
unsigned int pxbLayer(const DetId &id) const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:648
double dzError() const
error on dz
Definition: TrackBase.h:865
std::vector< TH1F * > h_norm_dz_pT_
Definition: DetId.h:18
GlobalPoint position() const
std::vector< TH1F * > h_dz_pT_
void shrinkHistVectorToFit(std::vector< TH1F * > &h, unsigned int desired_size)
std::vector< TH1F * > n_dzEtaBiasResiduals
std::vector< TH1F * > h_dz_Central_pT_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:485
bool isHit2D(const TrackingRecHit &hit) const
std::vector< TH1F * > h_dz_ladder_
std::vector< TH1F * > a_IP2DEtaResiduals
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
TrackClusterizerInZ * theTrackClusterizer_
std::vector< TH1F * > n_IP2DPhiResiduals
double xUnbiasedVertex_[nMaxtracks_]
std::vector< TH1F * > h_dxy_Central_pT_
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:936
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:926
edm::EDGetTokenT< reco::BeamSpot > theBeamspotToken
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
EventID const & id() const
double dzFromMyVertex_[nMaxtracks_]
fixed size matrix
std::array< float, nPtBins_+1 > mypT_bins_
static int position[264][3]
Definition: ReadPGInfo.cc:509
T get() const
Definition: EventSetup.h:71
std::vector< TH1F * > a_reszEtaResiduals
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37
double y0() const
y coordinate
Definition: BeamSpot.h:66
TH1F * a_dxyBiasResidualsMap[nMaxBins_][nMaxBins_]
std::vector< TH1F * > a_dxPhiResiduals
std::vector< TH1F * > h_norm_dz_modZ_
int charge() const
track electric charge
Definition: TrackBase.h:606
TH1F * n_dxyResidualsMap[nMaxBins_][nMaxBins_]
double normalizedChi2() const
chi-squared divided by n.d.o.f.
Definition: Vertex.h:107
double dxyErrorFromMyVertex_[nMaxtracks_]
std::vector< TH1F * > a_dyEtaResiduals
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:76
std::vector< TH1F * > n_IP2DEtaResiduals
std::vector< TH1F * > h_norm_dz_ladder_
float sumOfWeightsUnbiasedVertex_[nMaxtracks_]
TH1F * n_dzBiasResidualsMap[nMaxBins_][nMaxBins_]
double d3DErrorFromMyVertex_[nMaxtracks_]
std::vector< TH1F * > a_dyPhiResiduals
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:630
std::vector< TH1F * > h_dxy_ladderOverlap_
TH1F * a_dzBiasResidualsMap[nMaxBins_][nMaxBins_]
T x() const
Definition: PV3DBase.h:62
PVValHelper::histodetails theDetails_
T const * product() const
Definition: ESHandle.h:86
TH1F * a_dzResidualsMap[nMaxBins_][nMaxBins_]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
float chi2UnbiasedVertex_[nMaxtracks_]
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:71
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::vector< TH1F * > h_norm_dxy_Central_pT_
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::vector< TH1F * > a_dzEtaBiasResiduals
std::vector< TH1F * > a_IP3DPhiResiduals
std::vector< TH1F * > n_dzPhiBiasResiduals
double x0() const
x coordinate
Definition: BeamSpot.h:64
double IP3DsigFromMyVertex_[nMaxtracks_]
void PrimaryVertexValidation::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 1156 of file PrimaryVertexValidation.cc.

References a_d3DEtaResiduals, a_d3DPhiResiduals, a_d3DResidualsMap, a_dxEtaResiduals, a_dxPhiResiduals, a_dxyBiasResidualsMap, a_dxyEtaBiasResiduals, a_dxyEtaMADBiasTrend, a_dxyEtaMADTrend, a_dxyEtaMeanBiasTrend, a_dxyEtaMeanTrend, a_dxyEtaMedianBiasTrend, a_dxyEtaMedianTrend, a_dxyEtaResiduals, a_dxyEtaWidthBiasTrend, a_dxyEtaWidthTrend, a_dxyMeanBiasMap, a_dxyMeanMap, a_dxyPhiBiasResiduals, a_dxyPhiMADBiasTrend, a_dxyPhiMADTrend, a_dxyPhiMeanBiasTrend, a_dxyPhiMeanTrend, a_dxyPhiMedianBiasTrend, a_dxyPhiMedianTrend, a_dxyPhiResiduals, a_dxyPhiWidthBiasTrend, a_dxyPhiWidthTrend, a_dxypTCentralMeanTrend, a_dxypTCentralWidthTrend, a_dxypTMeanTrend, a_dxypTWidthTrend, a_dxyResidualsMap, a_dxyVsEta, a_dxyVsPhi, a_dxyWidthBiasMap, a_dxyWidthMap, a_dyEtaResiduals, a_dyPhiResiduals, a_dzBiasResidualsMap, a_dzEtaBiasResiduals, a_dzEtaMADBiasTrend, a_dzEtaMADTrend, a_dzEtaMeanBiasTrend, a_dzEtaMeanTrend, a_dzEtaMedianBiasTrend, a_dzEtaMedianTrend, a_dzEtaResiduals, a_dzEtaWidthBiasTrend, a_dzEtaWidthTrend, a_dzMeanBiasMap, a_dzMeanMap, a_dzPhiBiasResiduals, a_dzPhiMADBiasTrend, a_dzPhiMADTrend, a_dzPhiMeanBiasTrend, a_dzPhiMeanTrend, a_dzPhiMedianBiasTrend, a_dzPhiMedianTrend, a_dzPhiResiduals, a_dzPhiWidthBiasTrend, a_dzPhiWidthTrend, a_dzpTCentralMeanTrend, a_dzpTCentralWidthTrend, a_dzpTMeanTrend, a_dzpTWidthTrend, a_dzResidualsMap, a_dzVsEta, a_dzVsPhi, a_dzWidthBiasMap, a_dzWidthMap, a_IP2DEtaResiduals, a_IP2DPhiResiduals, a_IP3DEtaResiduals, a_IP3DPhiResiduals, a_reszEtaResiduals, a_reszPhiResiduals, Beamdxdz_, Beamsigmaz_, BeamWidthX_, BeamWidthY_, bookResidualsHistogram(), bookVertexHistograms(), BSx0_, BSy0_, BSz0_, charge_, chi2_, chi2ndof_, chi2normUnbiasedVertex_, chi2ProbUnbiasedVertex_, chi2UnbiasedVertex_, PVValHelper::d3D, d3DFromMyVertex_, DOFUnbiasedVertex_, PVValHelper::dx, PVValHelper::dxy, dxy_, dxyBs_, dxyErrorFromMyVertex_, dxyFromMyVertex_, PVValHelper::dy, PVValHelper::dz, dz_, dzBs_, dzErrorFromMyVertex_, dzFromMyVertex_, PVValHelper::eta, eta_, etaOfProbe_, EventNumber_, fs, PVValHelper::histodetails::getHigh(), h2_probeEtaPhi_, h2_probeEtaPt_, h_Beamsigmaz, h_BeamWidthX, h_BeamWidthY, h_BSx0, h_BSy0, h_BSz0, h_dxy_Central_pT_, h_dxy_ladder_, h_dxy_ladderNoOverlap_, h_dxy_ladderOverlap_, h_dxy_modZ_, h_dxy_pT_, h_dz_Central_pT_, h_dz_ladder_, h_dz_modZ_, h_dz_pT_, h_etaMax, h_fitVtxChi2_, h_fitVtxChi2ndf_, h_fitVtxChi2Prob_, h_fitVtxNdof_, h_fitVtxNtracks_, h_fitVtxTrackAverageWeight_, h_fitVtxTrackWeights_, h_lumiFromConfig, h_nbins, h_nClus, h_nLadders, h_nOfflineVertices, h_norm_dxy_Central_pT_, h_norm_dxy_ladder_, h_norm_dxy_modZ_, h_norm_dxy_pT_, h_norm_dz_Central_pT_, h_norm_dz_ladder_, h_norm_dz_modZ_, h_norm_dz_pT_, h_nTracks, h_probeCharge_, h_probeChi2_, h_probed0RefitV_, h_probed3DRefitV_, h_probedxyRecoV_, h_probedxyRefitV_, h_probedzRecoV_, h_probedzRefitV_, h_probeEta_, h_probeHasBPixL1Overlap_, h_probeHits1D_, h_probeHits2D_, h_probeHits_, h_probeHitsInBPIX_, h_probeHitsInFPIX_, h_probeHitsInTEC_, h_probeHitsInTIB_, h_probeHitsInTID_, h_probeHitsInTOB_, h_probeL1Ladder_, h_probeL1Module_, h_probeNormChi2_, h_probeP_, h_probePhi_, h_probePt_, h_probePtRebin_, h_probeQoverP_, h_probeRecoVSigXY_, h_probeRecoVSigZ_, h_probeRefitVLogSig3D_, h_probeRefitVSig3D_, h_probeRefitVSigResZ_, h_probeRefitVSigXY_, h_probeRefitVSigZ_, h_probereszRefitV_, h_probesignIP2DRefitV_, h_probez0RefitV_, h_pTinfo, h_recoVtxChi2ndf_, h_recoVtxChi2Prob_, h_recoVtxNtracks_, h_recoVtxSumPt_, h_runFromConfig, h_runFromEvent, h_runNumber, h_xErrOfflineVertex, h_xOfflineVertex, h_yErrOfflineVertex, h_yOfflineVertex, h_zErrOfflineVertex, h_zOfflineVertex, hasRecVertex_, hDA, PVValHelper::histodetails::histobins, mps_fire::i, intLumi_, PVValHelper::IP2D, PVValHelper::IP3D, IP3DsigFromMyVertex_, IPLsigFromMyVertex_, IPTsigFromMyVertex_, isGoodTrack_, isHighPurity_, PVValHelper::ladder, lightNtupleSwitch_, LuminosityBlockNumber_, M_PI, MADTrendsDir, TFileDirectory::make(), TFileService::make(), Mean2DMapsDir, MeanTrendsDir, MedianTrendsDir, TFileService::mkdir(), PVValHelper::modZ, mypT_bins_, n_d3DEtaResiduals, n_d3DPhiResiduals, n_d3DResidualsMap, n_dxyBiasResidualsMap, n_dxyEtaBiasResiduals, n_dxyEtaMADBiasTrend, n_dxyEtaMADTrend, n_dxyEtaMeanBiasTrend, n_dxyEtaMeanTrend, n_dxyEtaMedianBiasTrend, n_dxyEtaMedianTrend, n_dxyEtaResiduals, n_dxyEtaWidthBiasTrend, n_dxyEtaWidthTrend, n_dxyMeanBiasMap, n_dxyMeanMap, n_dxyPhiBiasResiduals, n_dxyPhiMADBiasTrend, n_dxyPhiMADTrend, n_dxyPhiMeanBiasTrend, n_dxyPhiMeanTrend, n_dxyPhiMedianBiasTrend, n_dxyPhiMedianTrend, n_dxyPhiResiduals, n_dxyPhiWidthBiasTrend, n_dxyPhiWidthTrend, n_dxypTCentralMeanTrend, n_dxypTCentralWidthTrend, n_dxypTMeanTrend, n_dxypTWidthTrend, n_dxyResidualsMap, n_dxyVsEta, n_dxyVsPhi, n_dxyWidthBiasMap, n_dxyWidthMap, n_dzBiasResidualsMap, n_dzEtaBiasResiduals, n_dzEtaMADBiasTrend, n_dzEtaMADTrend, n_dzEtaMeanBiasTrend, n_dzEtaMeanTrend, n_dzEtaMedianBiasTrend, n_dzEtaMedianTrend, n_dzEtaResiduals, n_dzEtaWidthBiasTrend, n_dzEtaWidthTrend, n_dzMeanBiasMap, n_dzMeanMap, n_dzPhiBiasResiduals, n_dzPhiMADBiasTrend, n_dzPhiMADTrend, n_dzPhiMeanBiasTrend, n_dzPhiMeanTrend, n_dzPhiMedianBiasTrend, n_dzPhiMedianTrend, n_dzPhiResiduals, n_dzPhiWidthBiasTrend, n_dzPhiWidthTrend, n_dzpTCentralMeanTrend, n_dzpTCentralWidthTrend, n_dzpTMeanTrend, n_dzpTWidthTrend, n_dzResidualsMap, n_dzVsEta, n_dzVsPhi, n_dzWidthBiasMap, n_dzWidthMap, n_IP2DEtaResiduals, n_IP2DPhiResiduals, n_IP3DEtaResiduals, n_IP3DPhiResiduals, n_reszEtaResiduals, n_reszPhiResiduals, nBins_, nClus_, Nevt_, nhits1D_, nhits2D_, nhits_, nhitsBPIX_, nhitsFPIX_, nhitsTEC_, nhitsTIB_, nhitsTID_, nhitsTOB_, nLadders_, nOfflineVertices_, PVValHelper::norm_d3D, PVValHelper::norm_dxy, PVValHelper::norm_dz, PVValHelper::norm_IP2D, PVValHelper::norm_IP3D, PVValHelper::norm_resz, nPtBins_, nTracks_, nTracksPerClus_, p_, PVValHelper::phi, phi_, PVValHelper::pT, pt_, PVValHelper::pTCentral, qoverp_, alignCSCRings::r, PVValHelper::resz, rootTree_, runControlNumbers_, RunNumber_, sumOfWeightsUnbiasedVertex_, theDetails_, theta_, tracksUsedForVertexing_, PVValHelper::histodetails::trendbins, useTracksFromRecoVtx_, Width2DMapsDir, WidthTrendsDir, xOfflineVertex_, xPCA_, xUnbiasedVertex_, yOfflineVertex_, yPCA_, yUnbiasedVertex_, zOfflineVertex_, zPCA_, and zUnbiasedVertex_.

1157 {
1158  edm::LogInfo("PrimaryVertexValidation")
1159  <<"######################################\n"
1160  <<"Begin Job \n"
1161  <<"######################################";
1162 
1163  // Define TTree for output
1164  Nevt_ = 0;
1165 
1166  // rootFile_ = new TFile(filename_.c_str(),"recreate");
1167  rootTree_ = fs->make<TTree>("tree","PV Validation tree");
1168 
1169  // Track Paramters
1170 
1171  if(lightNtupleSwitch_){
1172 
1173  rootTree_->Branch("EventNumber",&EventNumber_,"EventNumber/i");
1174  rootTree_->Branch("RunNumber",&RunNumber_,"RunNumber/i");
1175  rootTree_->Branch("LuminosityBlockNumber",&LuminosityBlockNumber_,"LuminosityBlockNumber/i");
1176  rootTree_->Branch("nOfflineVertices",&nOfflineVertices_,"nOfflineVertices/I");
1177  rootTree_->Branch("nTracks",&nTracks_,"nTracks/I");
1178  rootTree_->Branch("phi",&phi_,"phi[nTracks]/D");
1179  rootTree_->Branch("eta",&eta_,"eta[nTracks]/D");
1180  rootTree_->Branch("pt",&pt_,"pt[nTracks]/D");
1181  rootTree_->Branch("dxyFromMyVertex",&dxyFromMyVertex_,"dxyFromMyVertex[nTracks]/D");
1182  rootTree_->Branch("dzFromMyVertex",&dzFromMyVertex_,"dzFromMyVertex[nTracks]/D");
1183  rootTree_->Branch("d3DFromMyVertex",&d3DFromMyVertex_,"d3DFromMyVertex[nTracks]/D");
1184  rootTree_->Branch("IPTsigFromMyVertex",&IPTsigFromMyVertex_,"IPTsigFromMyVertex_[nTracks]/D");
1185  rootTree_->Branch("IPLsigFromMyVertex",&IPLsigFromMyVertex_,"IPLsigFromMyVertex_[nTracks]/D");
1186  rootTree_->Branch("IP3DsigFromMyVertex",&IP3DsigFromMyVertex_,"IP3DsigFromMyVertex_[nTracks]/D");
1187  rootTree_->Branch("hasRecVertex",&hasRecVertex_,"hasRecVertex[nTracks]/I");
1188  rootTree_->Branch("isGoodTrack",&isGoodTrack_,"isGoodTrack[nTracks]/I");
1189  rootTree_->Branch("isHighPurity",&isHighPurity_,"isHighPurity_[nTracks]/I");
1190 
1191  } else {
1192 
1193  rootTree_->Branch("nTracks",&nTracks_,"nTracks/I");
1194  rootTree_->Branch("nTracksPerClus",&nTracksPerClus_,"nTracksPerClus/I");
1195  rootTree_->Branch("nClus",&nClus_,"nClus/I");
1196  rootTree_->Branch("xOfflineVertex",&xOfflineVertex_,"xOfflineVertex/D");
1197  rootTree_->Branch("yOfflineVertex",&yOfflineVertex_,"yOfflineVertex/D");
1198  rootTree_->Branch("zOfflineVertex",&zOfflineVertex_,"zOfflineVertex/D");
1199  rootTree_->Branch("BSx0",&BSx0_,"BSx0/D");
1200  rootTree_->Branch("BSy0",&BSy0_,"BSy0/D");
1201  rootTree_->Branch("BSz0",&BSz0_,"BSz0/D");
1202  rootTree_->Branch("Beamsigmaz",&Beamsigmaz_,"Beamsigmaz/D");
1203  rootTree_->Branch("Beamdxdz",&Beamdxdz_,"Beamdxdz/D");
1204  rootTree_->Branch("BeamWidthX",&BeamWidthX_,"BeamWidthX/D");
1205  rootTree_->Branch("BeamWidthY",&BeamWidthY_,"BeamWidthY/D");
1206  rootTree_->Branch("pt",&pt_,"pt[nTracks]/D");
1207  rootTree_->Branch("p",&p_,"p[nTracks]/D");
1208  rootTree_->Branch("nhits",&nhits_,"nhits[nTracks]/I");
1209  rootTree_->Branch("nhits1D",&nhits1D_,"nhits1D[nTracks]/I");
1210  rootTree_->Branch("nhits2D",&nhits2D_,"nhits2D[nTracks]/I");
1211  rootTree_->Branch("nhitsBPIX",&nhitsBPIX_,"nhitsBPIX[nTracks]/I");
1212  rootTree_->Branch("nhitsFPIX",&nhitsFPIX_,"nhitsFPIX[nTracks]/I");
1213  rootTree_->Branch("nhitsTIB",&nhitsTIB_,"nhitsTIB[nTracks]/I");
1214  rootTree_->Branch("nhitsTID",&nhitsTID_,"nhitsTID[nTracks]/I");
1215  rootTree_->Branch("nhitsTOB",&nhitsTOB_,"nhitsTOB[nTracks]/I");
1216  rootTree_->Branch("nhitsTEC",&nhitsTEC_,"nhitsTEC[nTracks]/I");
1217  rootTree_->Branch("eta",&eta_,"eta[nTracks]/D");
1218  rootTree_->Branch("theta",&theta_,"theta[nTracks]/D");
1219  rootTree_->Branch("phi",&phi_,"phi[nTracks]/D");
1220  rootTree_->Branch("chi2",&chi2_,"chi2[nTracks]/D");
1221  rootTree_->Branch("chi2ndof",&chi2ndof_,"chi2ndof[nTracks]/D");
1222  rootTree_->Branch("charge",&charge_,"charge[nTracks]/I");
1223  rootTree_->Branch("qoverp",&qoverp_,"qoverp[nTracks]/D");
1224  rootTree_->Branch("dz",&dz_,"dz[nTracks]/D");
1225  rootTree_->Branch("dxy",&dxy_,"dxy[nTracks]/D");
1226  rootTree_->Branch("dzBs",&dzBs_,"dzBs[nTracks]/D");
1227  rootTree_->Branch("dxyBs",&dxyBs_,"dxyBs[nTracks]/D");
1228  rootTree_->Branch("xPCA",&xPCA_,"xPCA[nTracks]/D");
1229  rootTree_->Branch("yPCA",&yPCA_,"yPCA[nTracks]/D");
1230  rootTree_->Branch("zPCA",&zPCA_,"zPCA[nTracks]/D");
1231  rootTree_->Branch("xUnbiasedVertex",&xUnbiasedVertex_,"xUnbiasedVertex[nTracks]/D");
1232  rootTree_->Branch("yUnbiasedVertex",&yUnbiasedVertex_,"yUnbiasedVertex[nTracks]/D");
1233  rootTree_->Branch("zUnbiasedVertex",&zUnbiasedVertex_,"zUnbiasedVertex[nTracks]/D");
1234  rootTree_->Branch("chi2normUnbiasedVertex",&chi2normUnbiasedVertex_,"chi2normUnbiasedVertex[nTracks]/F");
1235  rootTree_->Branch("chi2UnbiasedVertex",&chi2UnbiasedVertex_,"chi2UnbiasedVertex[nTracks]/F");
1236  rootTree_->Branch("DOFUnbiasedVertex",&DOFUnbiasedVertex_," DOFUnbiasedVertex[nTracks]/F");
1237  rootTree_->Branch("chi2ProbUnbiasedVertex",&chi2ProbUnbiasedVertex_,"chi2ProbUnbiasedVertex[nTracks]/F");
1238  rootTree_->Branch("sumOfWeightsUnbiasedVertex",&sumOfWeightsUnbiasedVertex_,"sumOfWeightsUnbiasedVertex[nTracks]/F");
1239  rootTree_->Branch("tracksUsedForVertexing",&tracksUsedForVertexing_,"tracksUsedForVertexing[nTracks]/I");
1240  rootTree_->Branch("dxyFromMyVertex",&dxyFromMyVertex_,"dxyFromMyVertex[nTracks]/D");
1241  rootTree_->Branch("dzFromMyVertex",&dzFromMyVertex_,"dzFromMyVertex[nTracks]/D");
1242  rootTree_->Branch("dxyErrorFromMyVertex",&dxyErrorFromMyVertex_,"dxyErrorFromMyVertex_[nTracks]/D");
1243  rootTree_->Branch("dzErrorFromMyVertex",&dzErrorFromMyVertex_,"dzErrorFromMyVertex_[nTracks]/D");
1244  rootTree_->Branch("IPTsigFromMyVertex",&IPTsigFromMyVertex_,"IPTsigFromMyVertex_[nTracks]/D");
1245  rootTree_->Branch("IPLsigFromMyVertex",&IPLsigFromMyVertex_,"IPLsigFromMyVertex_[nTracks]/D");
1246  rootTree_->Branch("hasRecVertex",&hasRecVertex_,"hasRecVertex[nTracks]/I");
1247  rootTree_->Branch("isGoodTrack",&isGoodTrack_,"isGoodTrack[nTracks]/I");
1248  }
1249 
1250  // event histograms
1251  TFileDirectory EventFeatures = fs->mkdir("EventFeatures");
1252 
1253  TH1F::SetDefaultSumw2(kTRUE);
1254 
1255  h_lumiFromConfig = EventFeatures.make<TH1F>("h_lumiFromConfig","luminosity from config;;luminosity of present run",1,-0.5,0.5);
1256  h_lumiFromConfig->SetBinContent(1,intLumi_);
1257 
1258  h_runFromConfig = EventFeatures.make<TH1I>("h_runFromConfig","run number from config;;run number (from configuration)",
1259  runControlNumbers_.size(),0.,runControlNumbers_.size());
1260  for(const auto r : runControlNumbers_){
1261  h_runFromConfig->SetBinContent(r+1, r);
1262  }
1263 
1264  h_runFromEvent = EventFeatures.make<TH1I>("h_runFromEvent","run number from config;;run number (from event)",1,-0.5,0.5);
1265  h_nTracks = EventFeatures.make<TH1F>("h_nTracks","number of tracks per event;n_{tracks}/event;n_{events}",300,-0.5,299.5);
1266  h_nClus = EventFeatures.make<TH1F>("h_nClus","number of track clusters;n_{clusters}/event;n_{events}",50,-0.5,49.5);
1267  h_nOfflineVertices = EventFeatures.make<TH1F>("h_nOfflineVertices","number of offline reconstructed vertices;n_{vertices}/event;n_{events}",50,-0.5,49.5);
1268  h_runNumber = EventFeatures.make<TH1F>("h_runNumber","run number;run number;n_{events}",100000,250000.,350000.);
1269  h_xOfflineVertex = EventFeatures.make<TH1F>("h_xOfflineVertex","x-coordinate of offline vertex;x_{vertex};n_{events}",100,-0.1,0.1);
1270  h_yOfflineVertex = EventFeatures.make<TH1F>("h_yOfflineVertex","y-coordinate of offline vertex;y_{vertex};n_{events}",100,-0.1,0.1);
1271  h_zOfflineVertex = EventFeatures.make<TH1F>("h_zOfflineVertex","z-coordinate of offline vertex;z_{vertex};n_{events}",100,-30.,30.);
1272  h_xErrOfflineVertex = EventFeatures.make<TH1F>("h_xErrOfflineVertex","x-coordinate error of offline vertex;err_{x}^{vtx};n_{events}",100,0.,0.01);
1273  h_yErrOfflineVertex = EventFeatures.make<TH1F>("h_yErrOfflineVertex","y-coordinate error of offline vertex;err_{y}^{vtx};n_{events}",100,0.,0.01);
1274  h_zErrOfflineVertex = EventFeatures.make<TH1F>("h_zErrOfflineVertex","z-coordinate error of offline vertex;err_{z}^{vtx};n_{events}",100,0.,10.);
1275  h_BSx0 = EventFeatures.make<TH1F>("h_BSx0","x-coordinate of reco beamspot;x^{BS}_{0};n_{events}",100,-0.1,0.1);
1276  h_BSy0 = EventFeatures.make<TH1F>("h_BSy0","y-coordinate of reco beamspot;y^{BS}_{0};n_{events}",100,-0.1,0.1);
1277  h_BSz0 = EventFeatures.make<TH1F>("h_BSz0","z-coordinate of reco beamspot;z^{BS}_{0};n_{events}",100,-1.,1.);
1278  h_Beamsigmaz = EventFeatures.make<TH1F>("h_Beamsigmaz","z-coordinate beam width;#sigma_{Z}^{beam};n_{events}",100,0.,1.);
1279  h_BeamWidthX = EventFeatures.make<TH1F>("h_BeamWidthX","x-coordinate beam width;#sigma_{X}^{beam};n_{events}",100,0.,0.01);
1280  h_BeamWidthY = EventFeatures.make<TH1F>("h_BeamWidthY","y-coordinate beam width;#sigma_{Y}^{beam};n_{events}",100,0.,0.01);
1281 
1282  h_etaMax = EventFeatures.make<TH1F>("etaMax","etaMax",1,-0.5,0.5);
1283  h_pTinfo = EventFeatures.make<TH1F>("pTinfo","pTinfo",3,-1.5,1.5);
1284  h_pTinfo->GetXaxis()->SetBinLabel(1,"n. bins");
1285  h_pTinfo->GetXaxis()->SetBinLabel(2,"pT min");
1286  h_pTinfo->GetXaxis()->SetBinLabel(3,"pT max");
1287 
1288  h_nbins = EventFeatures.make<TH1F>("nbins","nbins",1,-0.5,0.5);
1289  h_nLadders = EventFeatures.make<TH1F>("nladders","n. ladders",1,-0.5,0.5);
1290 
1291  // probe track histograms
1292  TFileDirectory ProbeFeatures = fs->mkdir("ProbeTrackFeatures");
1293 
1294  h_probePt_ = ProbeFeatures.make<TH1F>("h_probePt","p_{T} of probe track;track p_{T} (GeV); tracks",100,0.,50.);
1295  h_probePtRebin_ = ProbeFeatures.make<TH1F>("h_probePtRebin","p_{T} of probe track;track p_{T} (GeV); tracks",mypT_bins_.size()-1,mypT_bins_.data());
1296  h_probeP_ = ProbeFeatures.make<TH1F>("h_probeP","momentum of probe track;track p (GeV); tracks",100,0.,100.);
1297  h_probeEta_ = ProbeFeatures.make<TH1F>("h_probeEta","#eta of the probe track;track #eta;tracks",54,-2.8,2.8);
1298  h_probePhi_ = ProbeFeatures.make<TH1F>("h_probePhi","#phi of probe track;track #phi (rad);tracks",100,-3.15,3.15);
1299 
1300  h2_probeEtaPhi_ = ProbeFeatures.make<TH2F>("h2_probeEtaPhi","probe track #phi vs #eta;#eta of probe track;track #phi of probe track (rad); tracks",54,-2.8,2.8,100,-3.15,3.15);
1301  h2_probeEtaPt_ = ProbeFeatures.make<TH2F>("h2_probeEtaPt","probe track p_{T} vs #eta;#eta of probe track;track p_{T} (GeV); tracks",54,-2.8,2.8,100,0.,50.);
1302 
1303  h_probeChi2_ = ProbeFeatures.make<TH1F>("h_probeChi2","#chi^{2} of probe track;track #chi^{2}; tracks",100,0.,100.);
1304  h_probeNormChi2_ = ProbeFeatures.make<TH1F>("h_probeNormChi2"," normalized #chi^{2} of probe track;track #chi^{2}/ndof; tracks",100,0.,10.);
1305  h_probeCharge_ = ProbeFeatures.make<TH1F>("h_probeCharge","charge of profe track;track charge Q;tracks",3,-1.5,1.5);
1306  h_probeQoverP_ = ProbeFeatures.make<TH1F>("h_probeQoverP","q/p of probe track; track Q/p (GeV^{-1});tracks",200,-1.,1.);
1307  h_probedzRecoV_ = ProbeFeatures.make<TH1F>("h_probedzRecoV","d_{z}(V_{offline}) of probe track;track d_{z}(V_{off}) (cm);tracks",200,-1.,1.);
1308  h_probedxyRecoV_ = ProbeFeatures.make<TH1F>("h_probedxyRecoV","d_{xy}(V_{offline}) of probe track;track d_{xy}(V_{off}) (cm);tracks",200,-1.,1.);
1309  h_probedzRefitV_ = ProbeFeatures.make<TH1F>("h_probedzRefitV","d_{z}(V_{refit}) of probe track;track d_{z}(V_{fit}) (cm);tracks",200,-0.5,0.5);
1310  h_probesignIP2DRefitV_ = ProbeFeatures.make<TH1F>("h_probesignIPRefitV","ip_{2D}(V_{refit}) of probe track;track ip_{2D}(V_{fit}) (cm);tracks",200,-1.,1.);
1311  h_probedxyRefitV_ = ProbeFeatures.make<TH1F>("h_probedxyRefitV","d_{xy}(V_{refit}) of probe track;track d_{xy}(V_{fit}) (cm);tracks",200,-0.5,0.5);
1312 
1313  h_probez0RefitV_ = ProbeFeatures.make<TH1F>("h_probez0RefitV","z_{0}(V_{refit}) of probe track;track z_{0}(V_{fit}) (cm);tracks",200,-1.,1.);
1314  h_probed0RefitV_ = ProbeFeatures.make<TH1F>("h_probed0RefitV","d_{0}(V_{refit}) of probe track;track d_{0}(V_{fit}) (cm);tracks",200,-1.,1.);
1315 
1316  h_probed3DRefitV_ = ProbeFeatures.make<TH1F>("h_probed3DRefitV","d_{3D}(V_{refit}) of probe track;track d_{3D}(V_{fit}) (cm);tracks",200,0.,1.);
1317  h_probereszRefitV_ = ProbeFeatures.make<TH1F>("h_probeReszRefitV","z_{track} -z_{V_{refit}};track res_{z}(V_{refit}) (cm);tracks",200,-1.,1.);
1318 
1319  h_probeRecoVSigZ_ = ProbeFeatures.make<TH1F>("h_probeRecoVSigZ" ,"Longitudinal DCA Significance (reco);d_{z}(V_{off})/#sigma_{dz};tracks",100,-8,8);
1320  h_probeRecoVSigXY_ = ProbeFeatures.make<TH1F>("h_probeRecoVSigXY" ,"Transverse DCA Significance (reco);d_{xy}(V_{off})/#sigma_{dxy};tracks",100,-8,8);
1321  h_probeRefitVSigZ_ = ProbeFeatures.make<TH1F>("h_probeRefitVSigZ" ,"Longitudinal DCA Significance (refit);d_{z}(V_{fit})/#sigma_{dz};tracks",100,-8,8);
1322  h_probeRefitVSigXY_= ProbeFeatures.make<TH1F>("h_probeRefitVSigXY","Transverse DCA Significance (refit);d_{xy}(V_{fit})/#sigma_{dxy};tracks",100,-8,8);
1323  h_probeRefitVSig3D_= ProbeFeatures.make<TH1F>("h_probeRefitVSig3D","3D DCA Significance (refit);d_{3D}/#sigma_{3D};tracks",100,0.,20.);
1324  h_probeRefitVLogSig3D_ = ProbeFeatures.make<TH1F>("h_probeRefitVLogSig3D","log_{10}(3D DCA-Significance) (refit);log_{10}(d_{3D}/#sigma_{3D});tracks",100,-5.,4.);
1325  h_probeRefitVSigResZ_ = ProbeFeatures.make<TH1F>("h_probeRefitVSigResZ" ,"Longitudinal residual significance (refit);(z_{track} -z_{V_{fit}})/#sigma_{res_{z}};tracks",100,-8,8);
1326 
1327  h_probeHits_ = ProbeFeatures.make<TH1F>("h_probeNRechits" ,"N_{hits} ;N_{hits} ;tracks",40,-0.5,39.5);
1328  h_probeHits1D_ = ProbeFeatures.make<TH1F>("h_probeNRechits1D" ,"N_{hits} 1D ;N_{hits} 1D ;tracks",40,-0.5,39.5);
1329  h_probeHits2D_ = ProbeFeatures.make<TH1F>("h_probeNRechits2D" ,"N_{hits} 2D ;N_{hits} 2D ;tracks",40,-0.5,39.5);
1330  h_probeHitsInTIB_ = ProbeFeatures.make<TH1F>("h_probeNRechitsTIB" ,"N_{hits} TIB ;N_{hits} TIB;tracks",40,-0.5,39.5);
1331  h_probeHitsInTOB_ = ProbeFeatures.make<TH1F>("h_probeNRechitsTOB" ,"N_{hits} TOB ;N_{hits} TOB;tracks",40,-0.5,39.5);
1332  h_probeHitsInTID_ = ProbeFeatures.make<TH1F>("h_probeNRechitsTID" ,"N_{hits} TID ;N_{hits} TID;tracks",40,-0.5,39.5);
1333  h_probeHitsInTEC_ = ProbeFeatures.make<TH1F>("h_probeNRechitsTEC" ,"N_{hits} TEC ;N_{hits} TEC;tracks",40,-0.5,39.5);
1334  h_probeHitsInBPIX_ = ProbeFeatures.make<TH1F>("h_probeNRechitsBPIX","N_{hits} BPIX;N_{hits} BPIX;tracks",40,-0.5,39.5);
1335  h_probeHitsInFPIX_ = ProbeFeatures.make<TH1F>("h_probeNRechitsFPIX","N_{hits} FPIX;N_{hits} FPIX;tracks",40,-0.5,39.5);
1336 
1337  h_probeL1Ladder_ = ProbeFeatures.make<TH1F>("h_probeL1Ladder","Ladder number (L1 hit); ladder number",22,-1.5,20.5);
1338  h_probeL1Module_ = ProbeFeatures.make<TH1F>("h_probeL1Module","Module number (L1 hit); module number",10,-1.5,8.5);
1339  h_probeHasBPixL1Overlap_ = ProbeFeatures.make<TH1I>("h_probeHasBPixL1Overlap","n. hits in L1;n. L1-BPix hits;tracks",5,0,5);
1340 
1341  // refit vertex features
1342  TFileDirectory RefitVertexFeatures = fs->mkdir("RefitVertexFeatures");
1343  h_fitVtxNtracks_ = RefitVertexFeatures.make<TH1F>("h_fitVtxNtracks" ,"N_{trks} used in vertex fit;N^{fit}_{tracks};vertices" ,100,-0.5,99.5);
1344  h_fitVtxNdof_ = RefitVertexFeatures.make<TH1F>("h_fitVtxNdof" ,"N_{DOF} of vertex fit;N_{DOF} of refit vertex;vertices" ,100,-0.5,99.5);
1345  h_fitVtxChi2_ = RefitVertexFeatures.make<TH1F>("h_fitVtxChi2" ,"#chi^{2} of vertex fit;vertex #chi^{2};vertices" ,100,-0.5,99.5);
1346  h_fitVtxChi2ndf_ = RefitVertexFeatures.make<TH1F>("h_fitVtxChi2ndf" ,"#chi^{2}/ndf of vertex fit;vertex #chi^{2}/ndf;vertices" ,100,-0.5,9.5);
1347  h_fitVtxChi2Prob_ = RefitVertexFeatures.make<TH1F>("h_fitVtxChi2Prob" ,"Prob(#chi^{2},ndf) of vertex fit;Prob(#chi^{2},ndf);vertices",40,0.,1.);
1348  h_fitVtxTrackWeights_ = RefitVertexFeatures.make<TH1F>("h_fitVtxTrackWeights","track weights associated to track;track weights;tracks",40,0.,1.);
1349  h_fitVtxTrackAverageWeight_ = RefitVertexFeatures.make<TH1F>("h_fitVtxTrackAverageWeight_","average track weight per vertex;#LT track weight #GT;vertices",40,0.,1.);
1350 
1351  if(useTracksFromRecoVtx_) {
1352 
1353  TFileDirectory RecoVertexFeatures = fs->mkdir("RecoVertexFeatures");
1354  h_recoVtxNtracks_ = RecoVertexFeatures.make<TH1F>("h_recoVtxNtracks" ,"N^{vtx}_{trks};N^{vtx}_{trks};vertices" ,100,-0.5,99.5);
1355  h_recoVtxChi2ndf_ = RecoVertexFeatures.make<TH1F>("h_recoVtxChi2ndf" ,"#chi^{2}/ndf vtx;#chi^{2}/ndf vtx;vertices" ,10,-0.5,9.5);
1356  h_recoVtxChi2Prob_ = RecoVertexFeatures.make<TH1F>("h_recoVtxChi2Prob" ,"Prob(#chi^{2},ndf);Prob(#chi^{2},ndf);vertices",40,0.,1.);
1357  h_recoVtxSumPt_ = RecoVertexFeatures.make<TH1F>("h_recoVtxSumPt" ,"Sum(p^{trks}_{T});Sum(p^{trks}_{T});vertices" ,100,0.,200.);
1358 
1359  }
1360 
1361 
1362  TFileDirectory DA = fs->mkdir("DA");
1363  //DA.cd();
1365  //for(std::map<std::string,TH1*>::const_iterator hist=hDA.begin(); hist!=hDA.end(); hist++){
1366  //hist->second->SetDirectory(DA);
1367  // DA.make<TH1F>(hist->second);
1368  // }
1369 
1370  // initialize the residuals histograms
1371 
1372  const float dxymax_phi = theDetails_.getHigh(PVValHelper::dxy,PVValHelper::phi);
1373  const float dzmax_phi = theDetails_.getHigh(PVValHelper::dz ,PVValHelper::eta);
1374  const float dxymax_eta = theDetails_.getHigh(PVValHelper::dxy,PVValHelper::phi);
1375  const float dzmax_eta = theDetails_.getHigh(PVValHelper::dz, PVValHelper::eta);
1376  //const float d3Dmax_phi = theDetails_.getHigh(PVValHelper::d3D,PVValHelper::phi);
1377  const float d3Dmax_eta = theDetails_.getHigh(PVValHelper::d3D,PVValHelper::eta);
1378 
1380  //
1381  // Unbiased track-to-vertex residuals
1382  // The vertex is refit without the probe track
1383  //
1385 
1386  // _ _ _ _ ___ _ _ _
1387  // /_\ | |__ ___ ___| |_ _| |_ ___ | _ \___ __(_)__| |_ _ __ _| |___
1388  // / _ \| '_ (_-</ _ \ | || | _/ -_) | / -_|_-< / _` | || / _` | (_-<
1389  // /_/ \_\_.__/__/\___/_|\_,_|\__\___| |_|_\___/__/_\__,_|\_,_\__,_|_/__/
1390  //
1391 
1392  TFileDirectory AbsTransPhiRes = fs->mkdir("Abs_Transv_Phi_Residuals");
1397 
1398  TFileDirectory AbsTransEtaRes = fs->mkdir("Abs_Transv_Eta_Residuals");
1403 
1404  TFileDirectory AbsLongPhiRes = fs->mkdir("Abs_Long_Phi_Residuals");
1407 
1408  TFileDirectory AbsLongEtaRes = fs->mkdir("Abs_Long_Eta_Residuals");
1411 
1412  TFileDirectory Abs3DPhiRes = fs->mkdir("Abs_3D_Phi_Residuals");
1415 
1416  TFileDirectory Abs3DEtaRes = fs->mkdir("Abs_3D_Eta_Residuals");
1419 
1420  TFileDirectory NormTransPhiRes = fs->mkdir("Norm_Transv_Phi_Residuals");
1423 
1424  TFileDirectory NormTransEtaRes = fs->mkdir("Norm_Transv_Eta_Residuals");
1427 
1428  TFileDirectory NormLongPhiRes = fs->mkdir("Norm_Long_Phi_Residuals");
1431 
1432  TFileDirectory NormLongEtaRes = fs->mkdir("Norm_Long_Eta_Residuals");
1435 
1436  TFileDirectory Norm3DPhiRes = fs->mkdir("Norm_3D_Phi_Residuals");
1439 
1440  TFileDirectory Norm3DEtaRes = fs->mkdir("Norm_3D_Eta_Residuals");
1443 
1444  TFileDirectory AbsDoubleDiffRes = fs->mkdir("Abs_DoubleDiffResiduals");
1445  TFileDirectory NormDoubleDiffRes = fs->mkdir("Norm_DoubleDiffResiduals");
1446 
1447  // book residuals vs pT histograms
1448 
1449  TFileDirectory AbsTranspTRes = fs->mkdir("Abs_Transv_pT_Residuals");
1451 
1452  TFileDirectory AbsLongpTRes = fs->mkdir("Abs_Long_pT_Residuals");
1454 
1455  TFileDirectory NormTranspTRes = fs->mkdir("Norm_Transv_pT_Residuals");
1457 
1458  TFileDirectory NormLongpTRes = fs->mkdir("Norm_Long_pT_Residuals");
1460 
1461  // book residuals vs pT histograms in central region (|eta|<1.0)
1462 
1463  TFileDirectory AbsTranspTCentralRes = fs->mkdir("Abs_Transv_pTCentral_Residuals");
1465 
1466  TFileDirectory AbsLongpTCentralRes = fs->mkdir("Abs_Long_pTCentral_Residuals");
1468 
1469  TFileDirectory NormTranspTCentralRes = fs->mkdir("Norm_Transv_pTCentral_Residuals");
1471 
1472  TFileDirectory NormLongpTCentralRes = fs->mkdir("Norm_Long_pTCentral_Residuals");
1474 
1475  // book residuals vs module number
1476 
1477  TFileDirectory AbsTransModZRes = fs->mkdir("Abs_Transv_modZ_Residuals");
1479 
1480  TFileDirectory AbsLongModZRes = fs->mkdir("Abs_Long_modZ_Residuals");
1482 
1483 
1484  // _ _ _ _ _ ___ _ _ _
1485  // | \| |___ _ _ _ __ __ _| (_)______ __| | | _ \___ __(_)__| |_ _ __ _| |___
1486  // | .` / _ \ '_| ' \/ _` | | |_ / -_) _` | | / -_|_-< / _` | || / _` | (_-<
1487  // |_|\_\___/_| |_|_|_\__,_|_|_/__\___\__,_| |_|_\___/__/_\__,_|\_,_\__,_|_/__/
1488  //
1489 
1490  TFileDirectory NormTransModZRes = fs->mkdir("Norm_Transv_modZ_Residuals");
1492 
1493  TFileDirectory NormLongModZRes = fs->mkdir("Norm_Long_modZ_Residuals");
1495 
1496  TFileDirectory AbsTransLadderRes = fs->mkdir("Abs_Transv_ladder_Residuals");
1498 
1499  TFileDirectory AbsTransLadderResOverlap = fs->mkdir("Abs_Transv_ladderOverlap_Residuals");
1501 
1502  TFileDirectory AbsTransLadderResNoOverlap = fs->mkdir("Abs_Transv_ladderNoOverlap_Residuals");
1504 
1505  TFileDirectory AbsLongLadderRes = fs->mkdir("Abs_Long_ladder_Residuals");
1507 
1508  TFileDirectory NormTransLadderRes = fs->mkdir("Norm_Transv_ladder_Residuals");
1510 
1511  TFileDirectory NormLongLadderRes = fs->mkdir("Norm_Long_ladder_Residuals");
1513 
1514 
1515  // book residuals as function of phi and eta
1516 
1517  for (int i=0; i<nBins_; ++i ) {
1518 
1519  float phiF = theDetails_.trendbins[PVValHelper::phi][i];
1520  float phiL = theDetails_.trendbins[PVValHelper::phi][i+1];
1521 
1522  // ___ _ _ ___ _ __ __ ___ _ _ _
1523  // | \ ___ _ _| |__| |___| \(_)/ _|/ _| | _ \___ __(_)__| |_ _ __ _| |___
1524  // | |) / _ \ || | '_ \ / -_) |) | | _| _| | / -_|_-< / _` | || / _` | (_-<
1525  // |___/\___/\_,_|_.__/_\___|___/|_|_| |_| |_|_\___/__/_\__,_|\_,_\__,_|_/__/
1526 
1527  for ( int j=0; j<nBins_; ++j ) {
1528 
1529  float etaF = theDetails_.trendbins[PVValHelper::eta][j];
1530  float etaL = theDetails_.trendbins[PVValHelper::eta][j+1];
1531 
1532  a_dxyResidualsMap[i][j] = AbsDoubleDiffRes.make<TH1F>(Form("histo_dxy_eta_plot%i_phi_plot%i",i,j),
1533  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{xy};tracks",etaF,etaL,phiF,phiL),
1534  theDetails_.histobins,-dzmax_eta,dzmax_eta);
1535 
1536  a_dzResidualsMap[i][j] = AbsDoubleDiffRes.make<TH1F>(Form("histo_dz_eta_plot%i_phi_plot%i",i,j),
1537  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{z};tracks",etaF,etaL,phiF,phiL),
1538  theDetails_.histobins,-dzmax_eta,dzmax_eta);
1539 
1540  a_d3DResidualsMap[i][j] = AbsDoubleDiffRes.make<TH1F>(Form("histo_d3D_eta_plot%i_phi_plot%i",i,j),
1541  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{3D};tracks",etaF,etaL,phiF,phiL),
1542  theDetails_.histobins,0.,d3Dmax_eta);
1543 
1544  n_dxyResidualsMap[i][j] = NormDoubleDiffRes.make<TH1F>(Form("histo_norm_dxy_eta_plot%i_phi_plot%i",i,j),
1545  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{xy}/#sigma_{d_{xy}};tracks",etaF,etaL,phiF,phiL),
1546  theDetails_.histobins,-dzmax_eta/100,dzmax_eta/100);
1547 
1548  n_dzResidualsMap[i][j] = NormDoubleDiffRes.make<TH1F>(Form("histo_norm_dz_eta_plot%i_phi_plot%i",i,j),
1549  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{z}/#sigma_{d_{z}};tracks",etaF,etaL,phiF,phiL),
1550  theDetails_.histobins,-dzmax_eta/100,dzmax_eta/100);
1551 
1552  n_d3DResidualsMap[i][j] = NormDoubleDiffRes.make<TH1F>(Form("histo_norm_d3D_eta_plot%i_phi_plot%i",i,j),
1553  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{3D}/#sigma_{d_{3D}};tracks",etaF,etaL,phiF,phiL),
1554  theDetails_.histobins,0.,d3Dmax_eta);
1555 
1556  }
1557  }
1558 
1559  // declaration of the directories
1560 
1561  TFileDirectory BiasVsParameter = fs->mkdir("BiasVsParameter");
1562 
1563  a_dxyVsPhi = BiasVsParameter.make<TH2F>("h2_dxy_vs_phi","d_{xy} vs track #phi;track #phi [rad];track d_{xy}(PV) [#mum]",
1564  nBins_,-M_PI,M_PI,theDetails_.histobins,-dxymax_phi,dxymax_phi);
1565 
1566  a_dzVsPhi = BiasVsParameter.make<TH2F>("h2_dz_vs_phi","d_{z} vs track #phi;track #phi [rad];track d_{z}(PV) [#mum]",
1567  nBins_,-M_PI,M_PI,theDetails_.histobins,-dzmax_phi,dzmax_phi);
1568 
1569  n_dxyVsPhi = BiasVsParameter.make<TH2F>("h2_n_dxy_vs_phi","d_{xy}/#sigma_{d_{xy}} vs track #phi;track #phi [rad];track d_{xy}(PV)/#sigma_{d_{xy}}",
1570  nBins_,-M_PI,M_PI,theDetails_.histobins,-dxymax_phi/100.,dxymax_phi/100.);
1571 
1572  n_dzVsPhi = BiasVsParameter.make<TH2F>("h2_n_dz_vs_phi","d_{z}/#sigma_{d_{z}} vs track #phi;track #phi [rad];track d_{z}(PV)/#sigma_{d_{z}}",
1573  nBins_,-M_PI,M_PI,theDetails_.histobins,-dzmax_phi/100.,dzmax_phi/100.);
1574 
1575  a_dxyVsEta = BiasVsParameter.make<TH2F>("h2_dxy_vs_eta","d_{xy} vs track #eta;track #eta;track d_{xy}(PV) [#mum]",
1576  nBins_,-etaOfProbe_,etaOfProbe_,theDetails_.histobins,-dxymax_eta,dzmax_eta);
1577 
1578  a_dzVsEta = BiasVsParameter.make<TH2F>("h2_dz_vs_eta","d_{z} vs track #eta;track #eta;track d_{z}(PV) [#mum]",
1579  nBins_,-etaOfProbe_,etaOfProbe_,theDetails_.histobins,-dzmax_eta,dzmax_eta);
1580 
1581  n_dxyVsEta = BiasVsParameter.make<TH2F>("h2_n_dxy_vs_eta","d_{xy}/#sigma_{d_{xy}} vs track #eta;track #eta;track d_{xy}(PV)/#sigma_{d_{xy}}",
1582  nBins_,-etaOfProbe_,etaOfProbe_,theDetails_.histobins,-dxymax_eta/100.,dxymax_eta/100.);
1583 
1584  n_dzVsEta = BiasVsParameter.make<TH2F>("h2_n_dz_vs_eta","d_{z}/#sigma_{d_{z}} vs track #eta;track #eta;track d_{z}(PV)/#sigma_{d_{z}}",
1585  nBins_,-etaOfProbe_,etaOfProbe_,theDetails_.histobins,-dzmax_eta/100.,dzmax_eta/100.);
1586 
1587  MeanTrendsDir = fs->mkdir("MeanTrends");
1588  WidthTrendsDir = fs->mkdir("WidthTrends");
1589  MedianTrendsDir = fs->mkdir("MedianTrends");
1590  MADTrendsDir = fs->mkdir("MADTrends");
1591 
1592  Mean2DMapsDir = fs->mkdir("MeanMaps");
1593  Width2DMapsDir = fs->mkdir("WidthMaps");
1594 
1595  double highedge=nBins_-0.5;
1596  double lowedge=-0.5;
1597 
1598  // means and widths from the fit
1599 
1600  a_dxyPhiMeanTrend = MeanTrendsDir.make<TH1F> ("means_dxy_phi",
1601  "#LT d_{xy} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{xy} #GT [#mum]",
1602  nBins_,lowedge,highedge);
1603 
1604  a_dxyPhiWidthTrend = WidthTrendsDir.make<TH1F>("widths_dxy_phi",
1605  "#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees];#sigma_{d_{xy}} [#mum]",
1606  nBins_,lowedge,highedge);
1607 
1608  a_dzPhiMeanTrend = MeanTrendsDir.make<TH1F> ("means_dz_phi",
1609  "#LT d_{z} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{z} #GT [#mum]",
1610  nBins_,lowedge,highedge);
1611 
1612  a_dzPhiWidthTrend = WidthTrendsDir.make<TH1F>("widths_dz_phi","#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];#sigma_{d_{z}} [#mum]",
1613  nBins_,lowedge,highedge);
1614 
1615  a_dxyEtaMeanTrend = MeanTrendsDir.make<TH1F> ("means_dxy_eta",
1616  "#LT d_{xy} #GT vs #eta sector;#eta (sector);#LT d_{xy} #GT [#mum]",
1617  nBins_,lowedge,highedge);
1618 
1619  a_dxyEtaWidthTrend = WidthTrendsDir.make<TH1F>("widths_dxy_eta",
1620  "#sigma_{d_{xy}} vs #eta sector;#eta (sector);#sigma_{d_{xy}} [#mum]",
1621  nBins_,lowedge,highedge);
1622 
1623  a_dzEtaMeanTrend = MeanTrendsDir.make<TH1F> ("means_dz_eta",
1624  "#LT d_{z} #GT vs #eta sector;#eta (sector);#LT d_{z} #GT [#mum]"
1625  ,nBins_,lowedge,highedge);
1626 
1627  a_dzEtaWidthTrend = WidthTrendsDir.make<TH1F>("widths_dz_eta",
1628  "#sigma_{d_{xy}} vs #eta sector;#eta (sector);#sigma_{d_{z}} [#mum]",
1629  nBins_,lowedge,highedge);
1630 
1631  n_dxyPhiMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dxy_phi",
1632  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{xy}/#sigma_{d_{xy}} #GT",
1633  nBins_,lowedge,highedge);
1634 
1635  n_dxyPhiWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dxy_phi",
1636  "width(d_{xy}/#sigma_{d_{xy}}) vs #phi sector;#varphi (sector) [degrees]; width(d_{xy}/#sigma_{d_{xy}})",
1637  nBins_,lowedge,highedge);
1638 
1639  n_dzPhiMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dz_phi",
1640  "#LT d_{z}/#sigma_{d_{z}} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{z}/#sigma_{d_{z}} #GT",
1641  nBins_,lowedge,highedge);
1642 
1643  n_dzPhiWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dz_phi",
1644  "width(d_{z}/#sigma_{d_{z}}) vs #phi sector;#varphi (sector) [degrees];width(d_{z}/#sigma_{d_{z}})",
1645  nBins_,lowedge,highedge);
1646 
1647  n_dxyEtaMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dxy_eta",
1648  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs #eta sector;#eta (sector);#LT d_{xy}/#sigma_{d_{z}} #GT",
1649  nBins_,lowedge,highedge);
1650 
1651  n_dxyEtaWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dxy_eta",
1652  "width(d_{xy}/#sigma_{d_{xy}}) vs #eta sector;#eta (sector);width(d_{xy}/#sigma_{d_{z}})",
1653  nBins_,lowedge,highedge);
1654 
1655  n_dzEtaMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dz_eta",
1656  "#LT d_{z}/#sigma_{d_{z}} #GT vs #eta sector;#eta (sector);#LT d_{z}/#sigma_{d_{z}} #GT",
1657  nBins_,lowedge,highedge);
1658 
1659  n_dzEtaWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dz_eta",
1660  "width(d_{z}/#sigma_{d_{z}}) vs #eta sector;#eta (sector);width(d_{z}/#sigma_{d_{z}})",
1661  nBins_,lowedge,highedge);
1662 
1663  // means and widhts vs pT and pTCentral
1664 
1665  a_dxypTMeanTrend = MeanTrendsDir.make<TH1F> ("means_dxy_pT",
1666  "#LT d_{xy} #GT vs pT;p_{T} [GeV];#LT d_{xy} #GT [#mum]",
1667  mypT_bins_.size()-1,mypT_bins_.data());
1668 
1669  a_dxypTWidthTrend = WidthTrendsDir.make<TH1F>("widths_dxy_pT",
1670  "#sigma_{d_{xy}} vs pT;p_{T} [GeV];#sigma_{d_{xy}} [#mum]",
1671  mypT_bins_.size()-1,mypT_bins_.data());
1672 
1673  a_dzpTMeanTrend = MeanTrendsDir.make<TH1F> ("means_dz_pT",
1674  "#LT d_{z} #GT vs pT;p_{T} [GeV];#LT d_{z} #GT [#mum]",
1675  mypT_bins_.size()-1,mypT_bins_.data());
1676 
1677  a_dzpTWidthTrend = WidthTrendsDir.make<TH1F>("widths_dz_pT","#sigma_{d_{z}} vs pT;p_{T} [GeV];#sigma_{d_{z}} [#mum]",
1678  mypT_bins_.size()-1,mypT_bins_.data());
1679 
1680 
1681  n_dxypTMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dxy_pT",
1682  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs pT;p_{T} [GeV];#LT d_{xy}/#sigma_{d_{xy}} #GT",
1683  mypT_bins_.size()-1,mypT_bins_.data());
1684 
1685  n_dxypTWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dxy_pT",
1686  "width(d_{xy}/#sigma_{d_{xy}}) vs pT;p_{T} [GeV]; width(d_{xy}/#sigma_{d_{xy}})",
1687  mypT_bins_.size()-1,mypT_bins_.data());
1688 
1689  n_dzpTMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dz_pT",
1690  "#LT d_{z}/#sigma_{d_{z}} #GT vs pT;p_{T} [GeV];#LT d_{z}/#sigma_{d_{z}} #GT",
1691  mypT_bins_.size()-1,mypT_bins_.data());
1692 
1693  n_dzpTWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dz_pT",
1694  "width(d_{z}/#sigma_{d_{z}}) vs pT;p_{T} [GeV];width(d_{z}/#sigma_{d_{z}})",
1695  mypT_bins_.size()-1,mypT_bins_.data());
1696 
1697 
1698  a_dxypTCentralMeanTrend = MeanTrendsDir.make<TH1F> ("means_dxy_pTCentral",
1699  "#LT d_{xy} #GT vs p_{T};p_{T}(|#eta|<1.) [GeV];#LT d_{xy} #GT [#mum]",
1700  mypT_bins_.size()-1,mypT_bins_.data());
1701 
1702  a_dxypTCentralWidthTrend = WidthTrendsDir.make<TH1F>("widths_dxy_pTCentral",
1703  "#sigma_{d_{xy}} vs p_{T};p_{T}(|#eta|<1.) [GeV];#sigma_{d_{xy}} [#mum]",
1704  mypT_bins_.size()-1,mypT_bins_.data());
1705 
1706  a_dzpTCentralMeanTrend = MeanTrendsDir.make<TH1F> ("means_dz_pTCentral",
1707  "#LT d_{z} #GT vs p_{T};p_{T}(|#eta|<1.) [GeV];#LT d_{z} #GT [#mum]"
1708  ,mypT_bins_.size()-1,mypT_bins_.data());
1709 
1710  a_dzpTCentralWidthTrend = WidthTrendsDir.make<TH1F>("widths_dz_pTCentral",
1711  "#sigma_{d_{z}} vs p_{T};p_{T}(|#eta|<1.) [GeV];#sigma_{d_{z}} [#mum]",
1712  mypT_bins_.size()-1,mypT_bins_.data());
1713 
1714  n_dxypTCentralMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dxy_pTCentral",
1715  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs p_{T};p_{T}(|#eta|<1.) [GeV];#LT d_{xy}/#sigma_{d_{z}} #GT",
1716  mypT_bins_.size()-1,mypT_bins_.data());
1717 
1718  n_dxypTCentralWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dxy_pTCentral",
1719  "width(d_{xy}/#sigma_{d_{xy}}) vs p_{T};p_{T}(|#eta|<1.) [GeV];width(d_{xy}/#sigma_{d_{z}})",
1720  mypT_bins_.size()-1,mypT_bins_.data());
1721 
1722  n_dzpTCentralMeanTrend = MeanTrendsDir.make<TH1F> ("norm_means_dz_pTCentral",
1723  "#LT d_{z}/#sigma_{d_{z}} #GT vs p_{T};p_{T}(|#eta|<1.) [GeV];#LT d_{z}/#sigma_{d_{z}} #GT",
1724  mypT_bins_.size()-1,mypT_bins_.data());
1725 
1726  n_dzpTCentralWidthTrend = WidthTrendsDir.make<TH1F>("norm_widths_dz_pTCentral",
1727  "width(d_{z}/#sigma_{d_{z}}) vs p_{T};p_{T}(|#eta|<1.) [GeV];width(d_{z}/#sigma_{d_{z}})",
1728  mypT_bins_.size()-1,mypT_bins_.data());
1729 
1730  // 2D maps
1731 
1732  a_dxyMeanMap = Mean2DMapsDir.make<TH2F> ("means_dxy_map",
1733  "#LT d_{xy} #GT map;#eta (sector);#varphi (sector) [degrees]",
1734  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1735 
1736  a_dzMeanMap = Mean2DMapsDir.make<TH2F> ("means_dz_map",
1737  "#LT d_{z} #GT map;#eta (sector);#varphi (sector) [degrees]",
1738  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1739 
1740  n_dxyMeanMap = Mean2DMapsDir.make<TH2F> ("norm_means_dxy_map",
1741  "#LT d_{xy}/#sigma_{d_{xy}} #GT map;#eta (sector);#varphi (sector) [degrees]",
1742  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1743 
1744  n_dzMeanMap = Mean2DMapsDir.make<TH2F> ("norm_means_dz_map",
1745  "#LT d_{z}/#sigma_{d_{z}} #GT map;#eta (sector);#varphi (sector) [degrees]",
1746  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1747 
1748  a_dxyWidthMap = Width2DMapsDir.make<TH2F> ("widths_dxy_map",
1749  "#sigma_{d_{xy}} map;#eta (sector);#varphi (sector) [degrees]",
1750  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1751 
1752  a_dzWidthMap = Width2DMapsDir.make<TH2F> ("widths_dz_map",
1753  "#sigma_{d_{z}} map;#eta (sector);#varphi (sector) [degrees]",
1754  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1755 
1756  n_dxyWidthMap = Width2DMapsDir.make<TH2F> ("norm_widths_dxy_map",
1757  "width(d_{xy}/#sigma_{d_{xy}}) map;#eta (sector);#varphi (sector) [degrees]",
1758  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1759 
1760  n_dzWidthMap = Width2DMapsDir.make<TH2F> ("norm_widths_dz_map",
1761  "width(d_{z}/#sigma_{d_{z}}) map;#eta (sector);#varphi (sector) [degrees]",
1762  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1763 
1764  // medians and MADs
1765 
1766  a_dxyPhiMedianTrend = MedianTrendsDir.make<TH1F>("medians_dxy_phi",
1767  "Median of d_{xy} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{xy}) [#mum]",
1768  nBins_,lowedge,highedge);
1769 
1770  a_dxyPhiMADTrend = MADTrendsDir.make<TH1F> ("MADs_dxy_phi",
1771  "Median absolute deviation of d_{xy} vs #phi sector;#varphi (sector) [degrees];MAD(d_{xy}) [#mum]",
1772  nBins_,lowedge,highedge);
1773 
1774  a_dzPhiMedianTrend = MedianTrendsDir.make<TH1F>("medians_dz_phi",
1775  "Median of d_{z} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{z}) [#mum]",
1776  nBins_,lowedge,highedge);
1777 
1778  a_dzPhiMADTrend = MADTrendsDir.make<TH1F> ("MADs_dz_phi",
1779  "Median absolute deviation of d_{z} vs #phi sector;#varphi (sector) [degrees];MAD(d_{z}) [#mum]",
1780  nBins_,lowedge,highedge);
1781 
1782  a_dxyEtaMedianTrend = MedianTrendsDir.make<TH1F>("medians_dxy_eta",
1783  "Median of d_{xy} vs #eta sector;#eta (sector);#mu_{1/2}(d_{xy}) [#mum]",
1784  nBins_,lowedge,highedge);
1785 
1786  a_dxyEtaMADTrend = MADTrendsDir.make<TH1F> ("MADs_dxy_eta",
1787  "Median absolute deviation of d_{xy} vs #eta sector;#eta (sector);MAD(d_{xy}) [#mum]",
1788  nBins_,lowedge,highedge);
1789 
1790  a_dzEtaMedianTrend = MedianTrendsDir.make<TH1F>("medians_dz_eta",
1791  "Median of d_{z} vs #eta sector;#eta (sector);#mu_{1/2}(d_{z}) [#mum]",
1792  nBins_,lowedge,highedge);
1793 
1794  a_dzEtaMADTrend = MADTrendsDir.make<TH1F> ("MADs_dz_eta",
1795  "Median absolute deviation of d_{z} vs #eta sector;#eta (sector);MAD(d_{z}) [#mum]",
1796  nBins_,lowedge,highedge);
1797 
1798  n_dxyPhiMedianTrend = MedianTrendsDir.make<TH1F>("norm_medians_dxy_phi",
1799  "Median of d_{xy}/#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{xy}/#sigma_{d_{xy}})",
1800  nBins_,lowedge,highedge);
1801 
1802  n_dxyPhiMADTrend = MADTrendsDir.make<TH1F> ("norm_MADs_dxy_phi",
1803  "Median absolute deviation of d_{xy}/#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees]; MAD(d_{xy}/#sigma_{d_{xy}})",
1804  nBins_,lowedge,highedge);
1805 
1806  n_dzPhiMedianTrend = MedianTrendsDir.make<TH1F>("norm_medians_dz_phi",
1807  "Median of d_{z}/#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{z}/#sigma_{d_{z}})",
1808  nBins_,lowedge,highedge);
1809 
1810  n_dzPhiMADTrend = MADTrendsDir.make<TH1F> ("norm_MADs_dz_phi",
1811  "Median absolute deviation of d_{z}/#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];MAD(d_{z}/#sigma_{d_{z}})",
1812  nBins_,lowedge,highedge);
1813 
1814  n_dxyEtaMedianTrend = MedianTrendsDir.make<TH1F>("norm_medians_dxy_eta",
1815  "Median of d_{xy}/#sigma_{d_{xy}} vs #eta sector;#eta (sector);#mu_{1/2}(d_{xy}/#sigma_{d_{z}})",
1816  nBins_,lowedge,highedge);
1817 
1818  n_dxyEtaMADTrend = MADTrendsDir.make<TH1F> ("norm_MADs_dxy_eta",
1819  "Median absolute deviation of d_{xy}/#sigma_{d_{xy}} vs #eta sector;#eta (sector);MAD(d_{xy}/#sigma_{d_{z}})",
1820  nBins_,lowedge,highedge);
1821 
1822  n_dzEtaMedianTrend = MedianTrendsDir.make<TH1F>("norm_medians_dz_eta",
1823  "Median of d_{z}/#sigma_{d_{z}} vs #eta sector;#eta (sector);#mu_{1/2}(d_{z}/#sigma_{d_{z}})",
1824  nBins_,lowedge,highedge);
1825 
1826  n_dzEtaMADTrend = MADTrendsDir.make<TH1F> ("norm_MADs_dz_eta",
1827  "Median absolute deviation of d_{z}/#sigma_{d_{z}} vs #eta sector;#eta (sector);MAD(d_{z}/#sigma_{d_{z}})",
1828  nBins_,lowedge,highedge);
1829 
1830 
1832  //
1833  // plots of biased residuals
1834  // The vertex includes the probe track
1835  //
1837 
1838  if (useTracksFromRecoVtx_){
1839 
1840  TFileDirectory AbsTransPhiBiasRes = fs->mkdir("Abs_Transv_Phi_BiasResiduals");
1842 
1843  TFileDirectory AbsTransEtaBiasRes = fs->mkdir("Abs_Transv_Eta_BiasResiduals");
1845 
1846  TFileDirectory AbsLongPhiBiasRes = fs->mkdir("Abs_Long_Phi_BiasResiduals");
1848 
1849  TFileDirectory AbsLongEtaBiasRes = fs->mkdir("Abs_Long_Eta_BiasResiduals");
1851 
1852  TFileDirectory NormTransPhiBiasRes = fs->mkdir("Norm_Transv_Phi_BiasResiduals");
1854 
1855  TFileDirectory NormTransEtaBiasRes = fs->mkdir("Norm_Transv_Eta_BiasResiduals");
1857 
1858  TFileDirectory NormLongPhiBiasRes = fs->mkdir("Norm_Long_Phi_BiasResiduals");
1860 
1861  TFileDirectory NormLongEtaBiasRes = fs->mkdir("Norm_Long_Eta_BiasResiduals");
1863 
1864  TFileDirectory AbsDoubleDiffBiasRes = fs->mkdir("Abs_DoubleDiffBiasResiduals");
1865  TFileDirectory NormDoubleDiffBiasRes = fs->mkdir("Norm_DoubleDiffBiasResiduals");
1866 
1867  for ( int i=0; i<nBins_; ++i ) {
1868 
1869  float phiF = theDetails_.trendbins[PVValHelper::phi][i];
1870  float phiL = theDetails_.trendbins[PVValHelper::phi][i+1];
1871 
1872  for ( int j=0; j<nBins_; ++j ) {
1873 
1874  float etaF = theDetails_.trendbins[PVValHelper::eta][j];
1875  float etaL = theDetails_.trendbins[PVValHelper::eta][j+1];
1876 
1877  a_dxyBiasResidualsMap[i][j] = AbsDoubleDiffBiasRes.make<TH1F>(Form("histo_dxy_eta_plot%i_phi_plot%i",i,j),
1878  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{xy} [#mum];tracks",etaF,etaL,phiF,phiL),
1879  theDetails_.histobins,-dzmax_eta,dzmax_eta);
1880 
1881  a_dzBiasResidualsMap[i][j] = AbsDoubleDiffBiasRes.make<TH1F>(Form("histo_dxy_eta_plot%i_phi_plot%i",i,j),
1882  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{z} [#mum];tracks",etaF,etaL,phiF,phiL),
1883  theDetails_.histobins,-dzmax_eta,dzmax_eta);
1884 
1885  n_dxyBiasResidualsMap[i][j] = NormDoubleDiffBiasRes.make<TH1F>(Form("histo_norm_dxy_eta_plot%i_phi_plot%i",i,j),
1886  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{xy}/#sigma_{d_{xy}};tracks",etaF,etaL,phiF,phiL),
1887  theDetails_.histobins,-dzmax_eta/100,dzmax_eta/100);
1888 
1889  n_dzBiasResidualsMap[i][j] = NormDoubleDiffBiasRes.make<TH1F>(Form("histo_norm_dxy_eta_plot%i_phi_plot%i",i,j),
1890  Form("%.2f<#eta_{tk}<%.2f %.2f#circ<#varphi_{tk}<%.2f#circ;d_{z}/#sigma_{d_{z}};tracks",etaF,etaL,phiF,phiL),
1891  theDetails_.histobins,-dzmax_eta/100,dzmax_eta/100);
1892  }
1893  }
1894 
1895  // declaration of the directories
1896 
1897  TFileDirectory MeanBiasTrendsDir = fs->mkdir("MeanBiasTrends");
1898  TFileDirectory WidthBiasTrendsDir = fs->mkdir("WidthBiasTrends");
1899  TFileDirectory MedianBiasTrendsDir = fs->mkdir("MedianBiasTrends");
1900  TFileDirectory MADBiasTrendsDir = fs->mkdir("MADBiasTrends");
1901 
1902  TFileDirectory Mean2DBiasMapsDir = fs->mkdir("MeanBiasMaps");
1903  TFileDirectory Width2DBiasMapsDir = fs->mkdir("WidthBiasMaps");
1904 
1905  // means and widths from the fit
1906 
1907  a_dxyPhiMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("means_dxy_phi",
1908  "#LT d_{xy} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{xy} #GT [#mum]",
1909  nBins_,lowedge,highedge);
1910 
1911  a_dxyPhiWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("widths_dxy_phi",
1912  "#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees];#sigma_{d_{xy}} [#mum]",
1913  nBins_,lowedge,highedge);
1914 
1915  a_dzPhiMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("means_dz_phi",
1916  "#LT d_{z} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{z} #GT [#mum]",
1917  nBins_,lowedge,highedge);
1918 
1919  a_dzPhiWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("widths_dz_phi",
1920  "#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];#sigma_{d_{z}} [#mum]",
1921  nBins_,lowedge,highedge);
1922 
1923  a_dxyEtaMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("means_dxy_eta",
1924  "#LT d_{xy} #GT vs #eta sector;#eta (sector);#LT d_{xy} #GT [#mum]",
1925  nBins_,lowedge,highedge);
1926 
1927  a_dxyEtaWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("widths_dxy_eta",
1928  "#sigma_{d_{xy}} vs #eta sector;#eta (sector);#sigma_{d_{xy}} [#mum]",
1929  nBins_,lowedge,highedge);
1930 
1931  a_dzEtaMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("means_dz_eta",
1932  "#LT d_{z} #GT vs #eta sector;#eta (sector);#LT d_{z} #GT [#mum]",
1933  nBins_,lowedge,highedge);
1934 
1935  a_dzEtaWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("widths_dz_eta",
1936  "#sigma_{d_{xy}} vs #eta sector;#eta (sector);#sigma_{d_{z}} [#mum]",
1937  nBins_,lowedge,highedge);
1938 
1939  n_dxyPhiMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("norm_means_dxy_phi",
1940  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{xy}/#sigma_{d_{xy}} #GT",
1941  nBins_,lowedge,highedge);
1942 
1943  n_dxyPhiWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("norm_widths_dxy_phi",
1944  "width(d_{xy}/#sigma_{d_{xy}}) vs #phi sector;#varphi (sector) [degrees]; width(d_{xy}/#sigma_{d_{xy}})",
1945  nBins_,lowedge,highedge);
1946 
1947  n_dzPhiMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("norm_means_dz_phi",
1948  "#LT d_{z}/#sigma_{d_{z}} #GT vs #phi sector;#varphi (sector) [degrees];#LT d_{z}/#sigma_{d_{z}} #GT",
1949  nBins_,lowedge,highedge);
1950 
1951  n_dzPhiWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("norm_widths_dz_phi",
1952  "width(d_{z}/#sigma_{d_{z}}) vs #phi sector;#varphi (sector) [degrees];width(d_{z}/#sigma_{d_{z}})",
1953  nBins_,lowedge,highedge);
1954 
1955  n_dxyEtaMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("norm_means_dxy_eta",
1956  "#LT d_{xy}/#sigma_{d_{xy}} #GT vs #eta sector;#eta (sector);#LT d_{xy}/#sigma_{d_{z}} #GT",
1957  nBins_,lowedge,highedge);
1958 
1959  n_dxyEtaWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("norm_widths_dxy_eta",
1960  "width(d_{xy}/#sigma_{d_{xy}}) vs #eta sector;#eta (sector);width(d_{xy}/#sigma_{d_{z}})",
1961  nBins_,lowedge,highedge);
1962 
1963  n_dzEtaMeanBiasTrend = MeanBiasTrendsDir.make<TH1F> ("norm_means_dz_eta",
1964  "#LT d_{z}/#sigma_{d_{z}} #GT vs #eta sector;#eta (sector);#LT d_{z}/#sigma_{d_{z}} #GT",
1965  nBins_,lowedge,highedge);
1966 
1967  n_dzEtaWidthBiasTrend = WidthBiasTrendsDir.make<TH1F>("norm_widths_dz_eta",
1968  "width(d_{z}/#sigma_{d_{z}}) vs #eta sector;#eta (sector);width(d_{z}/#sigma_{d_{z}})",
1969  nBins_,lowedge,highedge);
1970 
1971  // 2D maps
1972 
1973  a_dxyMeanBiasMap = Mean2DBiasMapsDir.make<TH2F> ("means_dxy_map",
1974  "#LT d_{xy} #GT map;#eta (sector);#varphi (sector) [degrees]",
1975  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1976 
1977  a_dzMeanBiasMap = Mean2DBiasMapsDir.make<TH2F> ("means_dz_map",
1978  "#LT d_{z} #GT map;#eta (sector);#varphi (sector) [degrees]",
1979  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1980 
1981  n_dxyMeanBiasMap = Mean2DBiasMapsDir.make<TH2F> ("norm_means_dxy_map",
1982  "#LT d_{xy}/#sigma_{d_{xy}} #GT map;#eta (sector);#varphi (sector) [degrees]",
1983  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1984 
1985  n_dzMeanBiasMap = Mean2DBiasMapsDir.make<TH2F> ("norm_means_dz_map",
1986  "#LT d_{z}/#sigma_{d_{z}} #GT map;#eta (sector);#varphi (sector) [degrees]",
1987  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1988 
1989  a_dxyWidthBiasMap = Width2DBiasMapsDir.make<TH2F> ("widths_dxy_map",
1990  "#sigma_{d_{xy}} map;#eta (sector);#varphi (sector) [degrees]",
1991  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1992 
1993  a_dzWidthBiasMap = Width2DBiasMapsDir.make<TH2F> ("widths_dz_map",
1994  "#sigma_{d_{z}} map;#eta (sector);#varphi (sector) [degrees]",
1995  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
1996 
1997  n_dxyWidthBiasMap = Width2DBiasMapsDir.make<TH2F> ("norm_widths_dxy_map",
1998  "width(d_{xy}/#sigma_{d_{xy}}) map;#eta (sector);#varphi (sector) [degrees]",
1999  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
2000 
2001  n_dzWidthBiasMap = Width2DBiasMapsDir.make<TH2F> ("norm_widths_dz_map",
2002  "width(d_{z}/#sigma_{d_{z}}) map;#eta (sector);#varphi (sector) [degrees]",
2003  nBins_,lowedge,highedge,nBins_,lowedge,highedge);
2004 
2005  // medians and MADs
2006 
2007  a_dxyPhiMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("medians_dxy_phi",
2008  "Median of d_{xy} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{xy}) [#mum]",
2009  nBins_,lowedge,highedge);
2010 
2011  a_dxyPhiMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("MADs_dxy_phi",
2012  "Median absolute deviation of d_{xy} vs #phi sector;#varphi (sector) [degrees];MAD(d_{xy}) [#mum]",
2013  nBins_,lowedge,highedge);
2014 
2015  a_dzPhiMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("medians_dz_phi",
2016  "Median of d_{z} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{z}) [#mum]",
2017  nBins_,lowedge,highedge);
2018 
2019  a_dzPhiMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("MADs_dz_phi",
2020  "Median absolute deviation of d_{z} vs #phi sector;#varphi (sector) [degrees];MAD(d_{z}) [#mum]",
2021  nBins_,lowedge,highedge);
2022 
2023  a_dxyEtaMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("medians_dxy_eta",
2024  "Median of d_{xy} vs #eta sector;#eta (sector);#mu_{1/2}(d_{xy}) [#mum]",
2025  nBins_,lowedge,highedge);
2026 
2027  a_dxyEtaMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("MADs_dxy_eta",
2028  "Median absolute deviation of d_{xy} vs #eta sector;#eta (sector);MAD(d_{xy}) [#mum]",
2029  nBins_,lowedge,highedge);
2030 
2031  a_dzEtaMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("medians_dz_eta",
2032  "Median of d_{z} vs #eta sector;#eta (sector);#mu_{1/2}(d_{z}) [#mum]",
2033  nBins_,lowedge,highedge);
2034 
2035  a_dzEtaMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("MADs_dz_eta",
2036  "Median absolute deviation of d_{z} vs #eta sector;#eta (sector);MAD(d_{z}) [#mum]",
2037  nBins_,lowedge,highedge);
2038 
2039  n_dxyPhiMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("norm_medians_dxy_phi",
2040  "Median of d_{xy}/#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{xy}/#sigma_{d_{xy}})",
2041  nBins_,lowedge,highedge);
2042 
2043  n_dxyPhiMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("norm_MADs_dxy_phi",
2044  "Median absolute deviation of d_{xy}/#sigma_{d_{xy}} vs #phi sector;#varphi (sector) [degrees]; MAD(d_{xy}/#sigma_{d_{xy}})",
2045  nBins_,lowedge,highedge);
2046 
2047  n_dzPhiMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("norm_medians_dz_phi",
2048  "Median of d_{z}/#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];#mu_{1/2}(d_{z}/#sigma_{d_{z}})",
2049  nBins_,lowedge,highedge);
2050 
2051  n_dzPhiMADBiasTrend = MADBiasTrendsDir.make<TH1F> ("norm_MADs_dz_phi",
2052  "Median absolute deviation of d_{z}/#sigma_{d_{z}} vs #phi sector;#varphi (sector) [degrees];MAD(d_{z}/#sigma_{d_{z}})",
2053  nBins_,lowedge,highedge);
2054 
2055  n_dxyEtaMedianBiasTrend = MedianBiasTrendsDir.make<TH1F>("norm_medians_dxy_eta",