#include "ANALYSIS/DHistogramActions.h" void DHistogramAction_PID::Initialize(JEventLoop* locEventLoop) { string locHistName, locHistTitle; string locParticleName, locParticleName2, locParticleROOTName, locParticleROOTName2; Particle_t locPID, locPID2; vector locParticleIDs; locEventLoop->Get(locParticleIDs); deque locDesiredPIDs; Get_Reaction()->Get_DetectedFinalPIDs(locDesiredPIDs); vector locMCThrowns; locEventLoop->Get(locMCThrowns); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { CreateAndChangeTo_ActionDirectory(); dParticleID = locParticleIDs[0]; dAnalysisUtilities = locAnalysisUtilitiesVector[0]; for(size_t loc_i = 0; loc_i < locDesiredPIDs.size(); ++loc_i) { locPID = locDesiredPIDs[loc_i]; locParticleName = ParticleType(locPID); locParticleROOTName = ParticleName_ROOT(locPID); CreateAndChangeTo_Directory(locParticleName, locParticleName); // Confidence Level locHistName = "PIDConfidenceLevel"; locHistTitle = locParticleROOTName + string(" PID;PID Confidence Level"); dHistMap_PIDFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); // Confidence Level in BCAL locHistName = "TOFConfidenceLevel_BCAL"; locHistTitle = locParticleROOTName + string(" PID in BCAL;TOF Confidence Level"); dHistMap_TOFFOM_BCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); // Confidence Level in FCAL locHistName = "TOFConfidenceLevel_FCAL"; locHistTitle = locParticleROOTName + string(" PID in FCAL;TOF Confidence Level"); dHistMap_TOFFOM_FCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); if(ParticleCharge(locPID) != 0) { // Confidence Level in TOF locHistName = "TOFConfidenceLevel_TOF"; locHistTitle = locParticleROOTName + string(" PID in TOF;TOF Confidence Level"); dHistMap_TOFFOM_TOF[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); // Confidence Level in CDC locHistName = "TOFConfidenceLevel_CDC"; locHistTitle = locParticleROOTName + string(" PID in CDC;TOF Confidence Level"); dHistMap_TOFFOM_CDC[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); // DC dE/dx Confidence Level locHistName = "DCdEdxConfidenceLevel"; locHistTitle = locParticleROOTName + string(" PID;DC #it{#frac{dE}{dx}} Confidence Level"); dHistMap_DCdEdxFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); } //beta vs p locHistName = "BetaVsP"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#beta"); dHistMap_BetaVsP[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumBetaBins, dMinBeta, dMaxBeta); //delta-beta vs p locHistName = "DeltaBetaVsP"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Delta#beta"); dHistMap_DeltaBetaVsP[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumDeltaBetaBins, dMinDeltaBeta, dMaxDeltaBeta); //TOF Confidence Level vs Delta-Beta locHistName = "TOFConfidenceLevelVsDeltaBeta"; locHistTitle = locParticleROOTName + string(";#Delta#beta;TOF Confidence Level"); dHistMap_TOFFOMVsDeltaBeta[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaBetaBins, dMinDeltaBeta, dMaxDeltaBeta, dNumFOMBins, 0.0, 1.0); //one per thrown pid: if(!locMCThrowns.empty()) { CreateAndChangeTo_Directory("Throwns", "Throwns"); for(size_t loc_j = 0; loc_j < dThrownPIDs.size(); ++loc_j) { locPID2 = dThrownPIDs[loc_j]; if((ParticleCharge(locPID2) != ParticleCharge(locPID)) && (locPID2 != Unknown)) continue; locParticleName2 = ParticleType(locPID2); locParticleROOTName2 = ParticleName_ROOT(locPID2); //Confidence Level for Thrown PID pair locPIDPair(locPID, locPID2); locHistName = string("PIDConfidenceLevel_ForThrownPID_") + locParticleName2; locHistTitle = locParticleROOTName + string(" PID, Thrown PID = ") + locParticleROOTName2 + string(";PID Confidence Level"); dHistMap_PIDFOMForTruePID[locPIDPair] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumFOMBins, 0.0, 1.0); } gDirectory->cd(".."); } CreateAndChangeTo_Directory("Pulls", "Pulls"); //Delta-t Pulls - CDC if(ParticleCharge(locPID) != 0) //CDC { locHistName = "TimePull_CDC"; locHistTitle = locParticleROOTName + string(";#Deltat/#sigma_{#Deltat}"); dHistMap_TimePull_CDC[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, -10.0, 10.0); locHistName = "TimePullVsTheta_CDC"; locHistTitle = locParticleROOTName + string(";#theta#circ;#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsTheta_CDC[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPullBins, -10.0, 10.0); locHistName = "TimePullVsP_CDC"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsP_CDC[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNum2DPullBins, -10.0, 10.0); } //Delta-t Pulls - BCAL locHistName = "TimePull_BCAL"; locHistTitle = locParticleROOTName + string(";#Deltat/#sigma_{#Deltat}"); dHistMap_TimePull_BCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, -10.0, 10.0); locHistName = "TimePullVsTheta_BCAL"; locHistTitle = locParticleROOTName + string(";#theta#circ;#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsTheta_BCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPullBins, -10.0, 10.0); locHistName = "TimePullVsP_BCAL"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsP_BCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNum2DPullBins, -10.0, 10.0); //Delta-t Pulls - TOF if(ParticleCharge(locPID) != 0) //TOF { locHistName = "TimePull_TOF"; locHistTitle = locParticleROOTName + string(";#Deltat/#sigma_{#Deltat}"); dHistMap_TimePull_TOF[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, -10.0, 10.0); locHistName = "TimePullVsP_TOF"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsP_TOF[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNum2DPullBins, -10.0, 10.0); } //Delta-t Pulls - FCAL locHistName = "TimePull_FCAL"; locHistTitle = locParticleROOTName + string(";#Deltat/#sigma_{#Deltat}"); dHistMap_TimePull_FCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, -10.0, 10.0); locHistName = "TimePullVsP_FCAL"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Deltat/#sigma_{#Deltat}"); dHistMap_TimePullVsP_FCAL[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNum2DPullBins, -10.0, 10.0); gDirectory->cd(".."); CreateAndChangeTo_Directory("PVsTheta", "PVsTheta"); // P Vs Theta, PID FOM < 1% locHistName = "PVsTheta_LowPIDFOM"; locHistTitle = locParticleROOTName + string(", PID FOM < 1%;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_LowPIDFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // P Vs Theta, PID FOM = NaN locHistName = "PVsTheta_NaNPIDFOM"; locHistTitle = locParticleROOTName + string(", PID FOM = NaN;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_NaNPIDFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); if(ParticleCharge(locPID) != 0) //no other sources of PID for neutrals { // P Vs Theta, TOF FOM < 1% locHistName = "PVsTheta_LowTOFFOM"; locHistTitle = locParticleROOTName + string(", TOF FOM < 1%;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_LowTOFFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // P Vs Theta, TOF FOM = NaN locHistName = "PVsTheta_NaNTOFFOM"; locHistTitle = locParticleROOTName + string(", TOF FOM = NaN;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_NaNTOFFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // P Vs Theta, DC dE/dx FOM < 1% locHistName = "PVsTheta_LowDCdEdxFOM"; locHistTitle = locParticleROOTName + string(", DC #it{#frac{dE}{dx}} FOM < 1%;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_LowDCdEdxFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // P Vs Theta, DC dE/dx FOM = NaN locHistName = "PVsTheta_NaNDCdEdxFOM"; locHistTitle = locParticleROOTName + string(", DC #it{#frac{dE}{dx}} FOM = NaN;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_NaNDCdEdxFOM[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // P Vs Theta, Beta < 0 locHistName = "PVsTheta_NegativeBeta"; locHistTitle = locParticleROOTName + string(", #beta < 0.0;#theta#circ;p (GeV/c)"); dHistMap_PVsTheta_NegativeBeta[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); } gDirectory->cd(".."); gDirectory->cd(".."); } //end of PID loop //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_PID::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_NumPreviousParticleCombos() == 0) dPreviouslyHistogrammedParticles.clear(); vector locMCThrownMatchingVector; locEventLoop->Get(locMCThrownMatchingVector); const DMCThrownMatching* locMCThrownMatching = locMCThrownMatchingVector.empty() ? NULL : locMCThrownMatchingVector[0]; const DEventRFBunch* locEventRFBunch = locParticleCombo->Get_EventRFBunch(); for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i) { const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i); deque locParticles; locParticleComboStep->Get_FinalParticles_Measured(locParticles); for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j) { if(!locParticleComboStep->Is_FinalParticleDetected(loc_j)) continue; //check if will be duplicate pair locParticleInfo(locParticles[loc_j]->PID(), locParticleComboStep->Get_FinalParticle_SourceObject(loc_j)); pair > locHistInfo(locEventRFBunch, locParticleInfo); if(dPreviouslyHistogrammedParticles.find(locHistInfo) != dPreviouslyHistogrammedParticles.end()) continue; //previously histogrammed dPreviouslyHistogrammedParticles.insert(locHistInfo); if(locParticleComboStep->Is_FinalParticleCharged(loc_j)) //charged Fill_ChargedHists(static_cast(locParticles[loc_j]), locMCThrownMatching, locEventRFBunch); else //neutral Fill_NeutralHists(static_cast(locParticles[loc_j]), locMCThrownMatching, locEventRFBunch); } } return true; } void DHistogramAction_PID::Fill_ChargedHists(const DChargedTrackHypothesis* locChargedTrackHypothesis, const DMCThrownMatching* locMCThrownMatching, const DEventRFBunch* locEventRFBunch) { Particle_t locPID = locChargedTrackHypothesis->PID(); double locBeta_Timing = locChargedTrackHypothesis->measuredBeta(); double locDeltaBeta = locChargedTrackHypothesis->deltaBeta(); double locFOM_Timing = (locChargedTrackHypothesis->dNDF_Timing > 0) ? TMath::Prob(locChargedTrackHypothesis->dChiSq_Timing, locChargedTrackHypothesis->dNDF_Timing) : numeric_limits::quiet_NaN(); double locFOM_DCdEdx = (locChargedTrackHypothesis->dNDF_DCdEdx > 0) ? TMath::Prob(locChargedTrackHypothesis->dChiSq_DCdEdx, locChargedTrackHypothesis->dNDF_DCdEdx) : numeric_limits::quiet_NaN(); double locP = locChargedTrackHypothesis->momentum().Mag(); double locTheta = locChargedTrackHypothesis->momentum().Theta()*180.0/TMath::Pi(); double locMatchFOM = 0.0; const DMCThrown* locMCThrown = (locMCThrownMatching != NULL) ? locMCThrownMatching->Get_MatchingMCThrown(locChargedTrackHypothesis, locMatchFOM) : NULL; double locTimePull = 0.0; unsigned int locTimeNDF = 0; dParticleID->Calc_TimingChiSq(locChargedTrackHypothesis, locTimeNDF, locTimePull); japp->RootWriteLock(); { dHistMap_PIDFOM[locPID]->Fill(locChargedTrackHypothesis->dFOM); if(locChargedTrackHypothesis->t1_detector() == SYS_CDC) { dHistMap_TOFFOM_CDC[locPID]->Fill(locFOM_Timing); dHistMap_TimePull_CDC[locPID]->Fill(locTimePull); dHistMap_TimePullVsTheta_CDC[locPID]->Fill(locTheta, locTimePull); dHistMap_TimePullVsP_CDC[locPID]->Fill(locP, locTimePull); } else if(locChargedTrackHypothesis->t1_detector() == SYS_BCAL) { dHistMap_TOFFOM_BCAL[locPID]->Fill(locFOM_Timing); dHistMap_TimePull_BCAL[locPID]->Fill(locTimePull); dHistMap_TimePullVsTheta_BCAL[locPID]->Fill(locTheta, locTimePull); dHistMap_TimePullVsP_BCAL[locPID]->Fill(locP, locTimePull); } else if(locChargedTrackHypothesis->t1_detector() == SYS_TOF) { dHistMap_TOFFOM_TOF[locPID]->Fill(locFOM_Timing); dHistMap_TimePull_TOF[locPID]->Fill(locTimePull); dHistMap_TimePullVsP_TOF[locPID]->Fill(locP, locTimePull); } else if(locChargedTrackHypothesis->t1_detector() == SYS_FCAL) { dHistMap_TOFFOM_FCAL[locPID]->Fill(locFOM_Timing); dHistMap_TimePull_FCAL[locPID]->Fill(locTimePull); dHistMap_TimePullVsP_FCAL[locPID]->Fill(locP, locTimePull); } dHistMap_DCdEdxFOM[locPID]->Fill(locFOM_DCdEdx); dHistMap_BetaVsP[locPID]->Fill(locP, locBeta_Timing); dHistMap_DeltaBetaVsP[locPID]->Fill(locP, locDeltaBeta); dHistMap_TOFFOMVsDeltaBeta[locPID]->Fill(locDeltaBeta, locFOM_Timing); pair locPIDPair(locPID, Unknown); //default unless matched if(locMCThrown != NULL) //else bogus track (not matched to any thrown tracks) locPIDPair.second = (Particle_t)(locMCThrown->type); //matched if(dHistMap_PIDFOMForTruePID.find(locPIDPair) != dHistMap_PIDFOMForTruePID.end()) //else hist not created or PID is weird dHistMap_PIDFOMForTruePID[locPIDPair]->Fill(locChargedTrackHypothesis->dFOM); if((locChargedTrackHypothesis->dFOM < 0.01) && (locChargedTrackHypothesis->dNDF > 0)) dHistMap_PVsTheta_LowPIDFOM[locPID]->Fill(locTheta, locP); else if(locChargedTrackHypothesis->dNDF == 0) //NaN dHistMap_PVsTheta_NaNPIDFOM[locPID]->Fill(locTheta, locP); if(locFOM_Timing < 0.01) dHistMap_PVsTheta_LowTOFFOM[locPID]->Fill(locTheta, locP); else if(locChargedTrackHypothesis->dNDF_Timing == 0) //NaN dHistMap_PVsTheta_NaNTOFFOM[locPID]->Fill(locTheta, locP); if(locFOM_DCdEdx < 0.01) dHistMap_PVsTheta_LowDCdEdxFOM[locPID]->Fill(locTheta, locP); else if(locChargedTrackHypothesis->dNDF_DCdEdx == 0) //NaN dHistMap_PVsTheta_NaNDCdEdxFOM[locPID]->Fill(locTheta, locP); if(locBeta_Timing < 0.0) dHistMap_PVsTheta_NegativeBeta[locPID]->Fill(locTheta, locP); } japp->RootUnLock(); } void DHistogramAction_PID::Fill_NeutralHists(const DNeutralParticleHypothesis* locNeutralParticleHypothesis, const DMCThrownMatching* locMCThrownMatching, const DEventRFBunch* locEventRFBunch) { Particle_t locPID = locNeutralParticleHypothesis->PID(); double locBeta_Timing = locNeutralParticleHypothesis->measuredBeta(); double locDeltaBeta = locNeutralParticleHypothesis->deltaBeta(); double locP = locNeutralParticleHypothesis->momentum().Mag(); double locTheta = locNeutralParticleHypothesis->momentum().Theta()*180.0/TMath::Pi(); double locMatchFOM = 0.0; const DMCThrown* locMCThrown = (locMCThrownMatching != NULL) ? locMCThrownMatching->Get_MatchingMCThrown(locNeutralParticleHypothesis, locMatchFOM) : NULL; double locTimePull = 0.0; unsigned int locTimeNDF = 0; dParticleID->Calc_TimingChiSq(locNeutralParticleHypothesis, locTimeNDF, locTimePull); japp->RootWriteLock(); { dHistMap_PIDFOM[locPID]->Fill(locNeutralParticleHypothesis->dFOM); if(locNeutralParticleHypothesis->t1_detector() == SYS_BCAL) { dHistMap_TOFFOM_BCAL[locPID]->Fill(locNeutralParticleHypothesis->dFOM); dHistMap_TimePull_BCAL[locPID]->Fill(locTimePull); dHistMap_TimePullVsTheta_BCAL[locPID]->Fill(locTheta, locTimePull); dHistMap_TimePullVsP_BCAL[locPID]->Fill(locP, locTimePull); } else if(locNeutralParticleHypothesis->t1_detector() == SYS_FCAL) { dHistMap_TOFFOM_FCAL[locPID]->Fill(locNeutralParticleHypothesis->dFOM); dHistMap_TimePull_FCAL[locPID]->Fill(locTimePull); dHistMap_TimePullVsP_FCAL[locPID]->Fill(locP, locTimePull); } dHistMap_BetaVsP[locPID]->Fill(locP, locBeta_Timing); dHistMap_DeltaBetaVsP[locPID]->Fill(locP, locDeltaBeta); dHistMap_TOFFOMVsDeltaBeta[locPID]->Fill(locDeltaBeta, locNeutralParticleHypothesis->dFOM); pair locPIDPair(locPID, Unknown); //default unless matched if(locMCThrown != NULL) //else bogus track (not matched to any thrown tracks) locPIDPair.second = (Particle_t)(locMCThrown->type); //matched if(dHistMap_PIDFOMForTruePID.find(locPIDPair) != dHistMap_PIDFOMForTruePID.end()) //else hist not created or PID is weird dHistMap_PIDFOMForTruePID[locPIDPair]->Fill(locNeutralParticleHypothesis->dFOM); if((locNeutralParticleHypothesis->dFOM < 0.01) && (locNeutralParticleHypothesis->dNDF > 0)) dHistMap_PVsTheta_LowPIDFOM[locPID]->Fill(locTheta, locP); else if(locNeutralParticleHypothesis->dNDF == 0) //NaN dHistMap_PVsTheta_NaNPIDFOM[locPID]->Fill(locTheta, locP); } japp->RootUnLock(); } void DHistogramAction_TrackVertexComparison::Initialize(JEventLoop* locEventLoop) { deque > locDetectedChargedPIDs; Get_Reaction()->Get_DetectedFinalPIDs(locDetectedChargedPIDs, 1); deque > locDetectedChargedPIDs_HasDupes; Get_Reaction()->Get_DetectedFinalPIDs(locDetectedChargedPIDs_HasDupes, 1, true); string locHistName, locHistTitle, locStepName, locStepROOTName, locParticleName, locParticleROOTName; Particle_t locPID, locHigherMassPID, locLowerMassPID; string locHigherMassParticleName, locLowerMassParticleName, locHigherMassParticleROOTName, locLowerMassParticleROOTName; vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); size_t locNumSteps = Get_Reaction()->Get_NumReactionSteps(); dHistDeque_TrackZToCommon.resize(locNumSteps); dHistDeque_TrackTToCommon.resize(locNumSteps); dHistDeque_TrackDOCAToCommon.resize(locNumSteps); dHistDeque_MaxTrackDeltaZ.resize(locNumSteps); dHistDeque_MaxTrackDeltaT.resize(locNumSteps); dHistDeque_MaxTrackDOCA.resize(locNumSteps); dHistDeque_TrackDeltaTVsP.resize(locNumSteps); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); for(size_t loc_i = 0; loc_i < locNumSteps; ++loc_i) { if(locDetectedChargedPIDs[loc_i].empty()) continue; const DReactionStep* locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i); locStepName = locReactionStep->Get_StepName(); locStepROOTName = locReactionStep->Get_StepROOTName(); CreateAndChangeTo_Directory(locStepName, locStepName); // Max Track DeltaZ locHistName = "MaxTrackDeltaZ"; locHistTitle = locStepROOTName + string(";Largest Track #DeltaVertex-Z (cm)"); dHistDeque_MaxTrackDeltaZ[loc_i] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaVertexZBins, 0.0, dMaxDeltaVertexZ); // Max Track DeltaT locHistName = "MaxTrackDeltaT"; locHistTitle = locStepROOTName + string(";Largest Track #DeltaVertex-T (ns)"); dHistDeque_MaxTrackDeltaT[loc_i] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaVertexTBins, 0.0, dMaxDeltaVertexT); // Max Track DOCA locHistName = "MaxTrackDOCA"; locHistTitle = locStepROOTName + string(";Largest Track DOCA (cm)"); dHistDeque_MaxTrackDOCA[loc_i] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDOCABins, 0.0, dMaxDOCA); for(size_t loc_j = 0; loc_j < locDetectedChargedPIDs[loc_i].size(); ++loc_j) { locPID = locDetectedChargedPIDs[loc_i][loc_j]; if(dHistDeque_TrackZToCommon[loc_i].find(locPID) != dHistDeque_TrackZToCommon[loc_i].end()) continue; //already created for this pid locParticleName = ParticleType(locPID); locParticleROOTName = ParticleName_ROOT(locPID); // TrackZ To Common locHistName = string("TrackZToCommon_") + locParticleName; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#DeltaVertex-Z (Track, Common) (cm)"); dHistDeque_TrackZToCommon[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaVertexZBins, dMinDeltaVertexZ, dMaxDeltaVertexZ); // TrackT To Common locHistName = string("TrackTToCommon_") + locParticleName; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#DeltaVertex-T (Track, Common) (ns)"); dHistDeque_TrackTToCommon[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaVertexTBins, dMinDeltaVertexT, dMaxDeltaVertexT); // TrackDOCA To Common locHistName = string("TrackDOCAToCommon_") + locParticleName; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";DOCA (Track, Common) (cm)"); dHistDeque_TrackDOCAToCommon[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDOCABins, dMinDOCA, dMaxDOCA); // DeltaT Vs P against beam photon if((locReactionStep->Get_InitialParticleID() == Gamma) && (dHistMap_BeamTrackDeltaTVsP.find(locPID) == dHistMap_BeamTrackDeltaTVsP.end())) { locHistName = string("TrackDeltaTVsP_") + ParticleType(locPID) + string("_Beam") + ParticleType(Gamma); locHistTitle = locStepROOTName + string(";") + ParticleName_ROOT(locPID) + string(" Momentum (GeV/c);t_{") + ParticleName_ROOT(locPID) + string("} - t_{Beam ") + ParticleName_ROOT(Gamma) + string("} (ns)"); dHistMap_BeamTrackDeltaTVsP[locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumDeltaVertexTBins, dMinDeltaVertexT, dMaxDeltaVertexT); } } //delta-t vs p for(int loc_j = 0; loc_j < int(locDetectedChargedPIDs_HasDupes[loc_i].size()) - 1; ++loc_j) { locPID = locDetectedChargedPIDs_HasDupes[loc_i][loc_j]; for(size_t loc_k = loc_j + 1; loc_k < locDetectedChargedPIDs_HasDupes[loc_i].size(); ++loc_k) { if(ParticleMass(locDetectedChargedPIDs_HasDupes[loc_i][loc_k]) > ParticleMass(locPID)) { locHigherMassPID = locDetectedChargedPIDs_HasDupes[loc_i][loc_k]; locLowerMassPID = locPID; } else { locHigherMassPID = locPID; locLowerMassPID = locDetectedChargedPIDs_HasDupes[loc_i][loc_k]; } pair locParticlePair(locHigherMassPID, locLowerMassPID); if(dHistDeque_TrackDeltaTVsP[loc_i].find(locParticlePair) != dHistDeque_TrackDeltaTVsP[loc_i].end()) continue; //already created for this pair locHigherMassParticleName = ParticleType(locHigherMassPID); locHigherMassParticleROOTName = ParticleName_ROOT(locHigherMassPID); locLowerMassParticleName = ParticleType(locLowerMassPID); locLowerMassParticleROOTName = ParticleName_ROOT(locLowerMassPID); // DeltaT Vs P locHistName = string("TrackDeltaTVsP_") + locHigherMassParticleName + string("_") + locLowerMassParticleName; locHistTitle = locStepROOTName + string(";") + locHigherMassParticleROOTName + string(" Momentum (GeV/c);t_{") + locHigherMassParticleROOTName + string("} - t_{") + locLowerMassParticleROOTName + string("} (ns)"); dHistDeque_TrackDeltaTVsP[loc_i][locParticlePair] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumDeltaVertexTBins, dMinDeltaVertexT, dMaxDeltaVertexT); } } gDirectory->cd(".."); } //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_TrackVertexComparison::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { Particle_t locPID; double locDOCA, locDeltaZ, locDeltaT, locMaxDOCA, locMaxDeltaZ, locMaxDeltaT; //note: very difficult to tell when results will be duplicate: just histogram all combos for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i) { const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i); deque locParticles; locParticleComboStep->Get_DetectedFinalChargedParticles_Measured(locParticles); if(locParticles.empty()) continue; //Grab/Find common vertex & time DVector3 locVertex = locParticleComboStep->Get_Position(); double locVertexTime = locParticleComboStep->Get_Time(); for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j) { locPID = locParticles[loc_j]->PID(); //find max's locMaxDOCA = -1.0; locMaxDeltaZ = -1.0; locMaxDeltaT = -1.0; for(size_t loc_k = loc_j + 1; loc_k < locParticles.size(); ++loc_k) { locDeltaZ = fabs(locParticles[loc_j]->position().Z() - locParticles[loc_k]->position().Z()); if(locDeltaZ > locMaxDeltaZ) locMaxDeltaZ = locDeltaZ; locDeltaT = fabs(locParticles[loc_j]->time() - locParticles[loc_k]->time()); if(locDeltaT > locMaxDeltaT) locMaxDeltaT = locDeltaT; locDOCA = dAnalysisUtilities->Calc_DOCA(locParticles[loc_j], locParticles[loc_k]); if(locDOCA > locMaxDOCA) locMaxDOCA = locDOCA; } //delta-t vs p deque > locParticlePairs; size_t locHigherMassParticleIndex, locLowerMassParticleIndex; //minimize number of locks by keeping track of the results and saving them at the end deque > locPIDPairs; deque locPs; deque locDeltaTs; for(size_t loc_k = loc_j + 1; loc_k < locParticles.size(); ++loc_k) { locParticlePairs.clear(); locParticlePairs.push_back(pair(locParticles[loc_j], loc_i)); locParticlePairs.push_back(pair(locParticles[loc_k], loc_i)); if(locParticles[loc_k]->mass() > locParticles[loc_j]->mass()) { locHigherMassParticleIndex = loc_k; locLowerMassParticleIndex = loc_j; } else { locHigherMassParticleIndex = loc_j; locLowerMassParticleIndex = loc_k; } locDeltaTs.push_back(locParticles[locHigherMassParticleIndex]->time() - locParticles[locLowerMassParticleIndex]->time()); locPs.push_back(locParticles[locHigherMassParticleIndex]->momentum().Mag()); locPIDPairs.push_back(pair(locParticles[locHigherMassParticleIndex]->PID(), locParticles[locLowerMassParticleIndex]->PID())); } const DKinematicData* locBeamParticle = (locParticleComboStep->Get_InitialParticleID() == Gamma) ? locParticleComboStep->Get_InitialParticle() : NULL; double locBeamDeltaT = (locBeamParticle != NULL) ? locParticles[loc_j]->time() - locBeamParticle->time() : numeric_limits::quiet_NaN(); locDOCA = dAnalysisUtilities->Calc_DOCAToVertex(locParticles[loc_j], locVertex); //HISTOGRAM //do all at once to reduce #locks & amount of time within the lock japp->RootWriteLock(); { //comparison to common vertex/time dHistDeque_TrackZToCommon[loc_i][locPID]->Fill(locParticles[loc_j]->position().Z() - locVertex.Z()); dHistDeque_TrackTToCommon[loc_i][locPID]->Fill(locParticles[loc_j]->time() - locVertexTime); dHistDeque_TrackDOCAToCommon[loc_i][locPID]->Fill(locDOCA); //hist max's if(locMaxDeltaZ > 0.0) //else none found (e.g. only 1 detected charged track) { dHistDeque_MaxTrackDeltaZ[loc_i]->Fill(locMaxDeltaZ); dHistDeque_MaxTrackDeltaT[loc_i]->Fill(locMaxDeltaT); dHistDeque_MaxTrackDOCA[loc_i]->Fill(locMaxDOCA); } //delta-t's if(locBeamParticle != NULL) dHistMap_BeamTrackDeltaTVsP[locPID]->Fill(locParticles[loc_j]->momentum().Mag(), locBeamDeltaT); for(size_t loc_k = 0; loc_k < locPIDPairs.size(); ++loc_k) { if(dHistDeque_TrackDeltaTVsP[loc_i].find(locPIDPairs[loc_k]) == dHistDeque_TrackDeltaTVsP[loc_i].end()) { //pair not found: equal masses and order switched somehow //e.g. mass set differently between REST and reconstruction pair locTempPIDPair(locPIDPairs[loc_k]); locPIDPairs[loc_k].first = locTempPIDPair.second; locPIDPairs[loc_k].second = locTempPIDPair.first; } dHistDeque_TrackDeltaTVsP[loc_i][locPIDPairs[loc_k]]->Fill(locPs[loc_k], locDeltaTs[loc_k]); } } japp->RootUnLock(); } //end of particle loop } //end of step loop return true; } void DHistogramAction_ParticleComboKinematics::Initialize(JEventLoop* locEventLoop) { if(Get_UseKinFitResultsFlag() && (Get_Reaction()->Get_KinFitType() == d_NoFit)) { cout << "WARNING: REQUESTED HISTOGRAM OF KINEMAITIC FIT RESULTS WHEN NO KINEMATIC FIT!!!" << endl; return; //no fit performed, but kinfit data requested!! } vector locParticleIDs; locEventLoop->Get(locParticleIDs); string locHistName, locHistTitle, locStepName, locStepROOTName, locParticleName, locParticleROOTName; Particle_t locPID; size_t locNumSteps = Get_Reaction()->Get_NumReactionSteps(); dHistDeque_PVsTheta.resize(locNumSteps); dHistDeque_PhiVsTheta.resize(locNumSteps); dHistDeque_BetaVsP.resize(locNumSteps); dHistDeque_DeltaBetaVsP.resize(locNumSteps); dHistDeque_P.resize(locNumSteps); dHistDeque_Theta.resize(locNumSteps); dHistDeque_Phi.resize(locNumSteps); dHistDeque_VertexZ.resize(locNumSteps); dHistDeque_VertexT.resize(locNumSteps); dHistDeque_VertexYVsX.resize(locNumSteps); deque > locDetectedFinalPIDs; Get_Reaction()->Get_DetectedFinalPIDs(locDetectedFinalPIDs); DApplication* locApplication = dynamic_cast(locEventLoop->GetJApplication()); DGeometry *locGeometry = locApplication->GetDGeometry(locEventLoop->GetJEvent().GetRunNumber()); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { CreateAndChangeTo_ActionDirectory(); dParticleID = locParticleIDs[0]; dAnalysisUtilities = locAnalysisUtilitiesVector[0]; locGeometry->GetTargetZ(dTargetZCenter); //beam particle locPID = Get_Reaction()->Get_ReactionStep(0)->Get_InitialParticleID(); bool locBeamParticleUsed = (locPID == Gamma); if(locBeamParticleUsed) { locParticleName = string("Beam_") + ParticleType(locPID); CreateAndChangeTo_Directory(locParticleName, locParticleName); locParticleROOTName = ParticleName_ROOT(locPID); // Momentum locHistName = "Momentum"; locHistTitle = string("Beam ") + locParticleROOTName + string(";p (GeV/c)"); dBeamParticleHist_P = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPBins, dMinP, dMaxP); // Theta locHistName = "Theta"; locHistTitle = string("Beam ") + locParticleROOTName + string(";#theta#circ"); dBeamParticleHist_Theta = GetOrCreate_Histogram(locHistName, locHistTitle, dNumThetaBins, dMinTheta, dMaxTheta); // Phi locHistName = "Phi"; locHistTitle = string("Beam ") + locParticleROOTName + string(";#phi#circ"); dBeamParticleHist_Phi = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPhiBins, dMinPhi, dMaxPhi); // P Vs Theta locHistName = "PVsTheta"; locHistTitle = string("Beam ") + locParticleROOTName + string(";#theta#circ;p (GeV/c)"); dBeamParticleHist_PVsTheta = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // Phi Vs Theta locHistName = "PhiVsTheta"; locHistTitle = string("Beam ") + locParticleROOTName + string(";#theta#circ;#phi#circ"); dBeamParticleHist_PhiVsTheta = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPhiBins, dMinPhi, dMaxPhi); // Vertex-Z locHistName = "VertexZ"; locHistTitle = string("Beam ") + locParticleROOTName + string(";Vertex-Z (cm)"); dBeamParticleHist_VertexZ = GetOrCreate_Histogram(locHistName, locHistTitle, dNumVertexZBins, dMinVertexZ, dMaxVertexZ); // Vertex-Y Vs Vertex-X locHistName = "VertexYVsX"; locHistTitle = string("Beam ") + locParticleROOTName + string(";Vertex-X (cm);Vertex-Y (cm)"); dBeamParticleHist_VertexYVsX = GetOrCreate_Histogram(locHistName, locHistTitle, dNumVertexXYBins, dMinVertexXY, dMaxVertexXY, dNumVertexXYBins, dMinVertexXY, dMaxVertexXY); // Vertex-T locHistName = "VertexT"; locHistTitle = string("Beam ") + locParticleROOTName + string(";Vertex-T (ns)"); dBeamParticleHist_VertexT = GetOrCreate_Histogram(locHistName, locHistTitle, dNumTBins, dMinT, dMaxT); // Delta-T (Beam, RF) locHistName = "DeltaTRF"; locHistTitle = string("Beam ") + locParticleROOTName + string(";#Deltat_{Beam - RF} (ns)"); dBeamParticleHist_DeltaTRF = GetOrCreate_Histogram(locHistName, locHistTitle, dNumDeltaTRFBins, dMinDeltaTRF, dMaxDeltaTRF); // Delta-T (Beam, RF) Vs Beam E locHistName = "DeltaTRFVsBeamE"; locHistTitle = string("Beam ") + locParticleROOTName + string(";E (GeV);#Deltat_{Beam - RF} (ns)"); dBeamParticleHist_DeltaTRFVsBeamE = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumDeltaTRFBins, dMinDeltaTRF, dMaxDeltaTRF); gDirectory->cd(".."); } //Steps deque locPIDs; for(size_t loc_i = 0; loc_i < locNumSteps; ++loc_i) { const DReactionStep* locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i); locStepName = locReactionStep->Get_StepName(); locStepROOTName = locReactionStep->Get_StepROOTName(); Particle_t locInitialPID = locReactionStep->Get_InitialParticleID(); //get PIDs if(!Get_UseKinFitResultsFlag()) //measured, ignore missing & decaying particles (ignore target anyway) locPIDs = locDetectedFinalPIDs[loc_i]; else //kinematic fit: decaying & missing particles are reconstructed { locReactionStep->Get_FinalParticleIDs(locPIDs); if((!locBeamParticleUsed) || (loc_i != 0)) //add decaying parent particle //skip if on beam particle! locPIDs.insert(locPIDs.begin(), locInitialPID); } if(locPIDs.empty()) continue; CreateAndChangeTo_Directory(locStepName, locStepName); for(size_t loc_j = 0; loc_j < locPIDs.size(); ++loc_j) { locPID = locPIDs[loc_j]; locParticleName = ParticleType(locPID); locParticleROOTName = ParticleName_ROOT(locPID); if(dHistDeque_P[loc_i].find(locPID) != dHistDeque_P[loc_i].end()) continue; //pid already done CreateAndChangeTo_Directory(locParticleName, locParticleName); // Momentum locHistName = "Momentum"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";p (GeV/c)"); dHistDeque_P[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPBins, dMinP, dMaxP); // Theta locHistName = "Theta"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#theta#circ"); dHistDeque_Theta[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumThetaBins, dMinTheta, dMaxTheta); // Phi locHistName = "Phi"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#phi#circ"); dHistDeque_Phi[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPhiBins, dMinPhi, dMaxPhi); // P Vs Theta locHistName = "PVsTheta"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#theta#circ;p (GeV/c)"); dHistDeque_PVsTheta[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPBins, dMinP, dMaxP); // Phi Vs Theta locHistName = "PhiVsTheta"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";#theta#circ;#phi#circ"); dHistDeque_PhiVsTheta[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DThetaBins, dMinTheta, dMaxTheta, dNum2DPhiBins, dMinPhi, dMaxPhi); //beta vs p locHistName = "BetaVsP"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#beta"); dHistDeque_BetaVsP[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumBetaBins, dMinBeta, dMaxBeta); //delta-beta vs p locHistName = "DeltaBetaVsP"; locHistTitle = locParticleROOTName + string(";p (GeV/c);#Delta#beta"); dHistDeque_DeltaBetaVsP[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNum2DPBins, dMinP, dMaxP, dNumDeltaBetaBins, dMinDeltaBeta, dMaxDeltaBeta); // Vertex-Z locHistName = "VertexZ"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";Vertex-Z (cm)"); dHistDeque_VertexZ[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumVertexZBins, dMinVertexZ, dMaxVertexZ); // Vertex-Y Vs Vertex-X locHistName = "VertexYVsX"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";Vertex-X (cm);Vertex-Y (cm)"); dHistDeque_VertexYVsX[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumVertexXYBins, dMinVertexXY, dMaxVertexXY, dNumVertexXYBins, dMinVertexXY, dMaxVertexXY); // Vertex-T locHistName = "VertexT"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(";Vertex-T (ns)"); dHistDeque_VertexT[loc_i][locPID] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumTBins, dMinT, dMaxT); gDirectory->cd(".."); } //end of particle loop gDirectory->cd(".."); } //end of step loop //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_ParticleComboKinematics::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_UseKinFitResultsFlag() && (Get_Reaction()->Get_KinFitType() == d_NoFit)) { cout << "WARNING: REQUESTED HISTOGRAM OF KINEMAITIC FIT RESULTS WHEN NO KINEMATIC FIT!!! Skipping histogram." << endl; return true; //no fit performed, but kinfit data requested!! } if(Get_NumPreviousParticleCombos() == 0) { dPreviouslyHistogrammedParticles.clear(); dPreviouslyHistogrammedBeamParticles.clear(); } const DEventRFBunch* locEventRFBunch = locParticleCombo->Get_EventRFBunch(); const DKinematicData* locKinematicData; for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i) { const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i); //initial particle if(Get_UseKinFitResultsFlag()) locKinematicData = locParticleComboStep->Get_InitialParticle(); else locKinematicData = locParticleComboStep->Get_InitialParticle_Measured(); if(locKinematicData != NULL) { if(locKinematicData->PID() == Gamma) { //check if will be duplicate const JObject* locSourceObject = locParticleComboStep->Get_InitialParticle_Measured(); if(dPreviouslyHistogrammedBeamParticles.find(locSourceObject) == dPreviouslyHistogrammedBeamParticles.end()) { dPreviouslyHistogrammedBeamParticles.insert(locSourceObject); Fill_BeamHists(locKinematicData, locEventRFBunch); } } else if(Get_UseKinFitResultsFlag()) //decaying particle, but kinfit so can hist Fill_Hists(locEventLoop, locKinematicData, locEventRFBunch, loc_i); //has many source object, and is unique to this combo: no dupes to check against: let it ride } //final particles for(size_t loc_j = 0; loc_j < locParticleComboStep->Get_NumFinalParticles(); ++loc_j) { if(Get_UseKinFitResultsFlag()) locKinematicData = locParticleComboStep->Get_FinalParticle(loc_j); else locKinematicData = locParticleComboStep->Get_FinalParticle_Measured(loc_j); if(locKinematicData == NULL) continue; //e.g. a decaying or missing particle whose params aren't set yet //check if duplicate const JObject* locSourceObject = locParticleComboStep->Get_FinalParticle_SourceObject(loc_j); if(locSourceObject != NULL) //else is reconstructed missing/decaying particle: has many source object, and is unique to this combo: no dupes to check against: let it ride { pair locParticleInfo(locKinematicData->PID(), locSourceObject); pair > locHistInfo(loc_i, locParticleInfo); if(dPreviouslyHistogrammedParticles.find(locHistInfo) != dPreviouslyHistogrammedParticles.end()) continue; //previously histogrammed dPreviouslyHistogrammedParticles.insert(locHistInfo); } Fill_Hists(locEventLoop, locKinematicData, locEventRFBunch, loc_i); } //end of particle loop } //end of step loop return true; } void DHistogramAction_ParticleComboKinematics::Fill_Hists(JEventLoop* locEventLoop, const DKinematicData* locKinematicData, const DEventRFBunch* locEventRFBunch, size_t locStepIndex) { Particle_t locPID = locKinematicData->PID(); DVector3 locMomentum = locKinematicData->momentum(); DVector3 locPosition = locKinematicData->position(); double locPhi = locMomentum.Phi()*180.0/TMath::Pi(); double locTheta = locMomentum.Theta()*180.0/TMath::Pi(); double locP = locMomentum.Mag(); double locBeta_Timing = locKinematicData->measuredBeta(); double locDeltaBeta = locKinematicData->deltaBeta(); japp->RootWriteLock(); { dHistDeque_P[locStepIndex][locPID]->Fill(locP); dHistDeque_Phi[locStepIndex][locPID]->Fill(locPhi); dHistDeque_Theta[locStepIndex][locPID]->Fill(locTheta); dHistDeque_PVsTheta[locStepIndex][locPID]->Fill(locTheta, locP); dHistDeque_PhiVsTheta[locStepIndex][locPID]->Fill(locTheta, locPhi); dHistDeque_BetaVsP[locStepIndex][locPID]->Fill(locP, locBeta_Timing); dHistDeque_DeltaBetaVsP[locStepIndex][locPID]->Fill(locP, locDeltaBeta); dHistDeque_VertexZ[locStepIndex][locPID]->Fill(locKinematicData->position().Z()); dHistDeque_VertexYVsX[locStepIndex][locPID]->Fill(locKinematicData->position().X(), locKinematicData->position().Y()); dHistDeque_VertexT[locStepIndex][locPID]->Fill(locKinematicData->time()); } japp->RootUnLock(); } void DHistogramAction_ParticleComboKinematics::Fill_BeamHists(const DKinematicData* locKinematicData, const DEventRFBunch* locEventRFBunch) { DVector3 locMomentum = locKinematicData->momentum(); double locPhi = locMomentum.Phi()*180.0/TMath::Pi(); double locTheta = locMomentum.Theta()*180.0/TMath::Pi(); double locP = locMomentum.Mag(); double locDeltaTRF = locKinematicData->time() - (locEventRFBunch->dTime + (locKinematicData->z() - dTargetZCenter)/29.9792458); japp->RootWriteLock(); { dBeamParticleHist_P->Fill(locP); dBeamParticleHist_Phi->Fill(locPhi); dBeamParticleHist_Theta->Fill(locTheta); dBeamParticleHist_PVsTheta->Fill(locTheta, locP); dBeamParticleHist_PhiVsTheta->Fill(locTheta, locPhi); dBeamParticleHist_VertexZ->Fill(locKinematicData->position().Z()); dBeamParticleHist_VertexYVsX->Fill(locKinematicData->position().X(), locKinematicData->position().Y()); dBeamParticleHist_VertexT->Fill(locKinematicData->time()); dBeamParticleHist_DeltaTRF->Fill(locDeltaTRF); dBeamParticleHist_DeltaTRFVsBeamE->Fill(locKinematicData->energy(), locDeltaTRF); } japp->RootUnLock(); } void DHistogramAction_InvariantMass::Initialize(JEventLoop* locEventLoop) { string locHistName, locHistTitle; double locMassPerBin = 1000.0*(dMaxMass - dMinMass)/((double)dNumMassBins); string locParticleNamesForHist = Get_Reaction()->Get_DecayChainFinalParticlesROOTNames(dInitialPID, Get_UseKinFitResultsFlag()); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); locHistName = "InvariantMass"; ostringstream locStream; locStream << locMassPerBin; locHistTitle = string(";") + locParticleNamesForHist + string(" Invariant Mass (GeV/c^{2});# Combos / ") + locStream.str() + string(" MeV/c^{2}"); dHist_InvaraintMass = GetOrCreate_Histogram(locHistName, locHistTitle, dNumMassBins, dMinMass, dMaxMass); //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_InvariantMass::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_NumPreviousParticleCombos() == 0) dPreviousSourceObjects.clear(); for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i) { const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i); if(locParticleComboStep->Get_InitialParticleID() != dInitialPID) continue; set > locSourceObjects; DLorentzVector locFinalStateP4 = dAnalysisUtilities->Calc_FinalStateP4(locParticleCombo, loc_i, locSourceObjects, Get_UseKinFitResultsFlag()); if(!dEnableDoubleCounting) { if(dPreviousSourceObjects.find(locSourceObjects) != dPreviousSourceObjects.end()) return true; //dupe: already histed! dPreviousSourceObjects.insert(locSourceObjects); } //get particle names so can select the correct histogram double locInvariantMass = locFinalStateP4.M(); japp->RootWriteLock(); { dHist_InvaraintMass->Fill(locInvariantMass); } japp->RootUnLock(); //don't break: e.g. if multiple pi0's, histogram invariant mass of each one } return true; } void DHistogramAction_MissingMass::Initialize(JEventLoop* locEventLoop) { double locMassPerBin = 1000.0*(dMaxMass - dMinMass)/((double)dNumMassBins); string locInitialParticlesROOTName = Get_Reaction()->Get_InitialParticlesROOTName(); string locFinalParticlesROOTName = Get_Reaction()->Get_DecayChainFinalParticlesROOTNames(0, dMissingMassOffOfStepIndex, dMissingMassOffOfPIDs, Get_UseKinFitResultsFlag(), true); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); string locHistName = "MissingMass"; ostringstream locStream; locStream << locMassPerBin; string locHistTitle = string(";") + locInitialParticlesROOTName + string("#rightarrow") + locFinalParticlesROOTName + string(" Missing Mass (GeV/c^{2});# Combos / ") + locStream.str() + string(" MeV/c^{2}"); dHist_MissingMass = GetOrCreate_Histogram(locHistName, locHistTitle, dNumMassBins, dMinMass, dMaxMass); //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_MissingMass::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_NumPreviousParticleCombos() == 0) dPreviousSourceObjects.clear(); set > locSourceObjects; DLorentzVector locMissingP4; if(dMissingMassOffOfStepIndex == -1) locMissingP4 = dAnalysisUtilities->Calc_MissingP4(locParticleCombo, locSourceObjects, Get_UseKinFitResultsFlag()); else locMissingP4 = dAnalysisUtilities->Calc_MissingP4(locParticleCombo, 0, dMissingMassOffOfStepIndex, dMissingMassOffOfPIDs, locSourceObjects, Get_UseKinFitResultsFlag()); if(!dEnableDoubleCounting) { if(dPreviousSourceObjects.find(locSourceObjects) != dPreviousSourceObjects.end()) return true; //dupe: already histed! dPreviousSourceObjects.insert(locSourceObjects); } double locMissingMass = locMissingP4.M(); japp->RootWriteLock(); { dHist_MissingMass->Fill(locMissingMass); } japp->RootUnLock(); return true; } void DHistogramAction_MissingMassSquared::Initialize(JEventLoop* locEventLoop) { double locMassSqPerBin = 1000.0*1000.0*(dMaxMassSq - dMinMassSq)/((double)dNumMassBins); string locInitialParticlesROOTName = Get_Reaction()->Get_InitialParticlesROOTName(); string locFinalParticlesROOTName = Get_Reaction()->Get_DecayChainFinalParticlesROOTNames(0, dMissingMassOffOfStepIndex, dMissingMassOffOfPIDs, Get_UseKinFitResultsFlag(), true); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); string locHistName = "MissingMassSquared"; ostringstream locStream; locStream << locMassSqPerBin; string locHistTitle = string(";") + locInitialParticlesROOTName + string("#rightarrow") + locFinalParticlesROOTName + string(" Missing Mass Squared (GeV/c^{2})^{2};# Combos / ") + locStream.str() + string(" (MeV/c^{2})^{2}"); dHist_MissingMassSquared = GetOrCreate_Histogram(locHistName, locHistTitle, dNumMassBins, dMinMassSq, dMaxMassSq); //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_MissingMassSquared::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_NumPreviousParticleCombos() == 0) dPreviousSourceObjects.clear(); set > locSourceObjects; DLorentzVector locMissingP4; if(dMissingMassOffOfStepIndex == -1) locMissingP4 = dAnalysisUtilities->Calc_MissingP4(locParticleCombo, locSourceObjects, Get_UseKinFitResultsFlag()); else locMissingP4 = dAnalysisUtilities->Calc_MissingP4(locParticleCombo, 0, dMissingMassOffOfStepIndex, dMissingMassOffOfPIDs, locSourceObjects, Get_UseKinFitResultsFlag()); if(!dEnableDoubleCounting) { if(dPreviousSourceObjects.find(locSourceObjects) != dPreviousSourceObjects.end()) return true; //dupe: already histed! dPreviousSourceObjects.insert(locSourceObjects); } double locMissingMassSquared = locMissingP4.M2(); japp->RootWriteLock(); { dHist_MissingMassSquared->Fill(locMissingMassSquared); } japp->RootUnLock(); return true; } void DHistogramAction_KinFitResults::Initialize(JEventLoop* locEventLoop) { string locHistName, locHistTitle, locParticleName, locParticleROOTName, locStepName, locStepROOTName; Particle_t locPID; DKinFitType locKinFitType = Get_Reaction()->Get_KinFitType(); if(locKinFitType == d_NoFit) return; deque > locDetectedPIDs; Get_Reaction()->Get_DetectedFinalPIDs(locDetectedPIDs); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); string locKinFitTypeString; if(locKinFitType == d_P4Fit) locKinFitTypeString = "P4"; else if(locKinFitType == d_VertexFit) locKinFitTypeString = "Vertex"; else if(locKinFitType == d_SpacetimeFit) locKinFitTypeString = "Spacetime"; else if(locKinFitType == d_P4AndVertexFit) locKinFitTypeString = "P4 & Vertex"; else if(locKinFitType == d_P4AndSpacetimeFit) locKinFitTypeString = "P4 & Spacetime"; // Confidence Level locHistName = "ConfidenceLevel"; locHistTitle = locKinFitTypeString + string(" Kinematic Fit;Confidence Level;# Combos"); dHist_ConfidenceLevel = GetOrCreate_Histogram(locHistName, locHistTitle, dNumConfidenceLevelBins, 0.0, 1.0); // Pulls map locParticlePulls; //beam pulls bool locBeamFlag = (Get_Reaction()->Get_ReactionStep(0)->Get_InitialParticleID() == Gamma); if(locBeamFlag) { CreateAndChangeTo_Directory("Beam", "Beam"); Create_ParticlePulls(true, "Beam", Gamma, dHistMap_BeamPulls, locKinFitTypeString); gDirectory->cd(".."); } //final particle pulls for(size_t loc_i = 0; loc_i < Get_Reaction()->Get_NumReactionSteps(); ++loc_i) { const DReactionStep* locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i); locStepName = locReactionStep->Get_StepName(); locStepROOTName = locReactionStep->Get_StepROOTName(); if(locDetectedPIDs[loc_i].empty()) continue; CreateAndChangeTo_Directory(locStepName, locStepName); for(size_t loc_j = 0; loc_j < locDetectedPIDs[loc_i].size(); ++loc_j) { locPID = locDetectedPIDs[loc_i][loc_j]; locParticleName = ParticleType(locPID); CreateAndChangeTo_Directory(locParticleName, locParticleName); Create_ParticlePulls(false, locStepROOTName, locPID, locParticlePulls, locKinFitTypeString); dHistMap_Pulls[pair(loc_i, locPID)] = locParticlePulls; gDirectory->cd(".."); } //end of particle loop gDirectory->cd(".."); } //end of step loop //RF Time Pull if(locBeamFlag && ((locKinFitType == d_SpacetimeFit) || (locKinFitType == d_P4AndSpacetimeFit))) { CreateAndChangeTo_Directory("RF", "RF"); //T Pull locHistName = "Pull_RF_T"; locHistTitle = string("RF Bunch, ") + locKinFitTypeString + string(" Fit;t Pull;# Combos"); dHist_RFTimePull = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); gDirectory->cd(".."); } //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } void DHistogramAction_KinFitResults::Create_ParticlePulls(bool locIsBeamFlag, string locStepROOTName, Particle_t locPID, map& locParticlePulls, const string& locKinFitTypeString) { string locHistName, locHistTitle, locParticleName, locParticleROOTName; locParticleName = ParticleType(locPID); locParticleROOTName = ParticleName_ROOT(locPID); DKinFitType locKinFitType = Get_Reaction()->Get_KinFitType(); locParticlePulls.clear(); bool locNeutralShowerFlag = ((ParticleCharge(locPID) == 0) && (!locIsBeamFlag) && (locKinFitType != d_P4Fit)); //p4 pulls: if(locNeutralShowerFlag) { //neutral shower not in a p4-only fit //E Pull locHistName = "Pull_E"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;E Pull;# Combos"); locParticlePulls[d_EPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); } else { //Px Pull locHistName = "Pull_Px"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;p_{x} Pull;# Combos"); locParticlePulls[d_PxPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); //Py Pull locHistName = "Pull_Py"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;p_{y} Pull;# Combos"); locParticlePulls[d_PyPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); //Pz Pull locHistName = "Pull_Pz"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;p_{z} Pull;# Combos"); locParticlePulls[d_PzPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); } //vertex pulls: if(locNeutralShowerFlag || (locKinFitType == d_VertexFit) || (locKinFitType == d_SpacetimeFit) || (locKinFitType == d_P4AndVertexFit) || (locKinFitType == d_P4AndSpacetimeFit)) { //Xx Pull locHistName = "Pull_Xx"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;x_{x} Pull;# Combos"); locParticlePulls[d_XxPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); //Xy Pull locHistName = "Pull_Xy"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;x_{y} Pull;# Combos"); locParticlePulls[d_XyPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); //Xz Pull locHistName = "Pull_Xz"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;x_{z} Pull;# Combos"); locParticlePulls[d_XzPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); } //time pulls: if((locKinFitType == d_SpacetimeFit) || (locKinFitType == d_P4AndSpacetimeFit)) { //T Pull locHistName = "Pull_T"; locHistTitle = locParticleROOTName + string(", ") + locStepROOTName + string(", ") + locKinFitTypeString + string(" Fit;t Pull;# Combos"); locParticlePulls[d_TPull] = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPullBins, dMinPull, dMaxPull); } } bool DHistogramAction_KinFitResults::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { //kinfit results are unique for each DParticleCombo: no need to check for duplicates const DKinFitResults* locKinFitResults = locParticleCombo->Get_KinFitResults(); if(locKinFitResults == NULL) return true; // Confidence Level double locConfidenceLevel = locKinFitResults->Get_ConfidenceLevel(); japp->RootWriteLock(); { if(string(dHist_ConfidenceLevel->GetXaxis()->GetTitle()) == string("Confidence Level")) { deque locKinFitConstraints; locKinFitResults->Get_KinFitConstraints(locKinFitConstraints); string locHistTitle = "Kinematic Fit Constraints: "; bool locFirstConstraintFlag = true; for(size_t loc_i = 0; loc_i < locKinFitConstraints.size(); ++loc_i) { string locConstraintString = locKinFitConstraints[loc_i]->Get_ConstraintString(); if(locConstraintString == "") continue; if(!locFirstConstraintFlag) locHistTitle += ", "; locFirstConstraintFlag = false; locHistTitle += locConstraintString; } dHist_ConfidenceLevel->SetTitle(locHistTitle.c_str()); ostringstream locAxisTitle; locAxisTitle << "Confidence Level (" << locKinFitResults->Get_NumConstraints() << " Constraints, " << locKinFitResults->Get_NumUnknowns(); locAxisTitle << " Unknowns: " << locKinFitResults->Get_NDF() << "-C Fit)"; dHist_ConfidenceLevel->GetXaxis()->SetTitle(locAxisTitle.str().c_str()); } dHist_ConfidenceLevel->Fill(locConfidenceLevel); } japp->RootUnLock(); if(locConfidenceLevel < dPullHistConfidenceLevelCut) return true; //don't histogram pulls // Pulls map > locPulls; //DKinematicData is the MEASURED particle locKinFitResults->Get_Pulls(locPulls); deque locParticles; map locParticlePulls; map::iterator locIterator; const DKinematicData* locKinematicData; // beam pulls bool locBeamFlag = (Get_Reaction()->Get_ReactionStep(0)->Get_InitialParticleID() == Gamma); if(locBeamFlag) { locKinematicData = locParticleCombo->Get_ParticleComboStep(0)->Get_InitialParticle_Measured(); locParticlePulls = locPulls[locKinematicData]; japp->RootWriteLock(); { for(locIterator = locParticlePulls.begin(); locIterator != locParticlePulls.end(); ++locIterator) dHistMap_BeamPulls[locIterator->first]->Fill(locIterator->second); } japp->RootUnLock(); } // final particle pulls for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i) { const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i); locParticleComboStep->Get_DetectedFinalParticles_Measured(locParticles); for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j) { locParticlePulls = locPulls[locParticles[loc_j]]; pair locParticlePair(loc_i, locParticles[loc_j]->PID()); japp->RootWriteLock(); { for(locIterator = locParticlePulls.begin(); locIterator != locParticlePulls.end(); ++locIterator) (dHistMap_Pulls[locParticlePair])[locIterator->first]->Fill(locIterator->second); } japp->RootUnLock(); } } //rf time pull DKinFitType locKinFitType = Get_Reaction()->Get_KinFitType(); if(locBeamFlag && ((locKinFitType == d_SpacetimeFit) || (locKinFitType == d_P4AndSpacetimeFit))) { locParticlePulls = locPulls[NULL]; japp->RootWriteLock(); { dHist_RFTimePull->Fill(locParticlePulls[d_TPull]); } japp->RootUnLock(); } return true; } void DHistogramAction_MissingTransverseMomentum::Initialize(JEventLoop* locEventLoop) { string locHistName, locHistTitle; double locPtPerBin = 1000.0*(dMaxPt - dMinPt)/((double)dNumPtBins); vector locAnalysisUtilitiesVector; locEventLoop->Get(locAnalysisUtilitiesVector); //CREATE THE HISTOGRAMS japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! { dAnalysisUtilities = locAnalysisUtilitiesVector[0]; CreateAndChangeTo_ActionDirectory(); locHistName = "MissingTransverseMomentum"; ostringstream locStream; locStream << locPtPerBin; locHistTitle = string(";") + string(" Missing Transverse Momentum (GeV/c);# Combos / ") + locStream.str() + string(" MeV/c"); dHist_MissingTransverseMomentum = GetOrCreate_Histogram(locHistName, locHistTitle, dNumPtBins, dMinPt, dMaxPt); //Return to the base directory ChangeTo_BaseDirectory(); } japp->RootUnLock(); //RELEASE ROOT LOCK!! } bool DHistogramAction_MissingTransverseMomentum::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { if(Get_NumPreviousParticleCombos() == 0) dPreviousSourceObjects.clear(); set > locSourceObjects; DLorentzVector locFinalStateP4 = dAnalysisUtilities->Calc_FinalStateP4(locParticleCombo, 0, locSourceObjects, Get_UseKinFitResultsFlag()); // Use step '0' if(!dEnableDoubleCounting) { if(dPreviousSourceObjects.find(locSourceObjects) != dPreviousSourceObjects.end()) return true; //dupe: already histed! dPreviousSourceObjects.insert(locSourceObjects); } double locMissingTransverseMomentum = locFinalStateP4.Pt(); japp->RootWriteLock(); { dHist_MissingTransverseMomentum->Fill(locMissingTransverseMomentum); } japp->RootUnLock(); return true; }