diff --git a/Analysis/SLDCorrection/README.md b/Analysis/SLDCorrection/README.md index 68038dff..c3173a6a 100644 --- a/Analysis/SLDCorrection/README.md +++ b/Analysis/SLDCorrection/README.md @@ -71,4 +71,18 @@ Green histograms are used to estimate the overall uncertainty due to neutrino co sigmaAlphaNu = 0.100 rad , sigmaENu = 4.0 GeV -In the end, neutrinos are assumed to be massless and sigmaAlphaNu and sigmaENu are transformed to a covariance matrix in (p,E) space. \ No newline at end of file +In the end, neutrinos are assumed to be massless and sigmaAlphaNu and sigmaENu are transformed to a covariance matrix in (p,E) space. + +### SLDStatus Reference +| SLDStatus | Interpretation | +|-----------|-------------------------------------------------| +| 0 | PrimaryVertex collection found, but empty | +| 1 | Reconstructed Lepton is not found | +| 2 | Reconstructed Lepton doesn't belong to any jet | +| 3 | Infer SLD from reconstructed lepton in primary vertex | +| 4 | Infer SLD from reconstructed lepton in a secondary (BuildUp) Vertex. | +| 5 | Infer SLD frmo BuildUp Vertex in a jet. Intersection point of Lepton and other BuildUp Vertices in jet is used as vertex of semi-leptonic decay. | +| 6 | Inferred from lepton track alone. | +| 7 | other | + +In the h_SLDStatus histogram, these values are inserted with a shift of -0.5 \ No newline at end of file diff --git a/Analysis/SLDCorrection/src/FlightDirection.cc b/Analysis/SLDCorrection/src/FlightDirection.cc index 95d1c34b..cdb6aeb1 100644 --- a/Analysis/SLDCorrection/src/FlightDirection.cc +++ b/Analysis/SLDCorrection/src/FlightDirection.cc @@ -33,6 +33,12 @@ int getRecoFlightDirection( const RecoParticle &linkedRecoLepton , TVector3 &rec daughterHadronFlightDistance = 0.0; daughterHadronFlightDirection = TVector3( 0.0 , 0.0 , 0.0 ); sldVertexPosition.clear(); + if ( linkedRecoLepton->getTracks().size() == 0 ) + { + streamlog_out(DEBUG1) << " (" << SLDStatus << ") No track for linkedRecoLepton. SLDCorrection aborts." << std::endl; + return SLDStatus; + } + if ( recoLeptonIsInVertex ) { SLDStatus = 4; @@ -116,9 +122,6 @@ int getRecoFlightDirection( const RecoParticle &linkedRecoLepton , TVector3 &rec // thirdVertex = testVertex; //} } - if ( thirdVertex != NULL ) - { - } } else { diff --git a/Analysis/SLDCorrection/src/SLDCorrection.cc b/Analysis/SLDCorrection/src/SLDCorrection.cc index 809f9330..a38ade00 100644 --- a/Analysis/SLDCorrection/src/SLDCorrection.cc +++ b/Analysis/SLDCorrection/src/SLDCorrection.cc @@ -801,7 +801,7 @@ void SLDCorrection::init() m_pTTree1->Branch( "DSVDistanceFromPV" , &m_DSVDistanceFromPV ); m_pTTree1->Branch( "Lepton3DImpactParameter" , &m_Lepton3DImpactParameter ); m_pTTree1->Branch( "OtherParticle3DImpactParameter" , &m_OtherParticle3DImpactParameter ); - h_SLDStatus = new TH1I( "SLDStatus" , ";" , 7 , 0 , 7 ); + h_SLDStatus = new TH1I( "SLDStatus" , ";" , 8 , -1 , 7 ); h_SLDStatus->GetXaxis()->SetBinLabel(1,"No #font[32]{l}^{REC}" ); h_SLDStatus->GetXaxis()->SetBinLabel(2,"#font[32]{l}#notin^{}jet" ); h_SLDStatus->GetXaxis()->SetBinLabel(3,"#font[32]{l}#in^{}Vtx^{Prim.}" ); @@ -1743,6 +1743,18 @@ void SLDCorrection::doSLDCorrection( EVENT::LCEvent *pLCEvent , const MCP &SLDLe LCRelationNavigator RecoMCParticleNav( pLCEvent->getCollection( m_RecoMCTruthLinkCollection ) ); LCRelationNavigator MCParticleRecoNav( pLCEvent->getCollection( m_MCTruthRecoLinkCollection ) ); LCCollection *primaryVertexCollection = pLCEvent->getCollection( m_inputPrimaryVertex ); + + int SLDStatus = -999; + if ( primaryVertexCollection->getNumberOfElements() == 0 ) + { + SLDStatus = 0; + streamlog_out(WARNING) << " ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" << std::endl; + streamlog_out(WARNING) << " ||||||||||||||||||||| PrimaryVertex is not found |||||||||||||||||||||" << std::endl; + streamlog_out(WARNING) << " ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" << std::endl; + if ( m_fillRootTree ) h_SLDStatus->Fill( -0.5 ); + return; + } + Vertex* primaryVertex = dynamic_cast( primaryVertexCollection->getElementAt( 0 ) ); Vertex* startVertex = dynamic_cast( primaryVertexCollection->getElementAt( 0 ) ); LCCollection *jetCollection = pLCEvent->getCollection( m_inputJetCollection ); @@ -1995,7 +2007,6 @@ void SLDCorrection::doSLDCorrection( EVENT::LCEvent *pLCEvent , const MCP &SLDLe //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - int SLDStatus = -999; if ( linkedRecoLepton == NULL ) { SLDStatus = 1; @@ -3536,39 +3547,7 @@ void SLDCorrection::end() h_secondaryVertex->GetYaxis()->SetTitle("#SLDecay [%]"); h_secondaryVertex->Write(); m_pTFile->Close(); - delete h_SLDStatus; - delete h_BHadronType; - delete h_CHadronType; - delete h_NuPxResidual; - delete h_NuPyResidual; - delete h_NuPzResidual; - delete h_NuEResidual; - delete h_NuPxNormalizedResidual; - delete h_NuPyNormalizedResidual; - delete h_NuPzNormalizedResidual; - delete h_NuENormalizedResidual; - delete h_recoNuPx_mcNuPx; - delete h_recoNuPy_mcNuPy; - delete h_recoNuPz_mcNuPz; - delete h_recoNuE_mcNuE; - delete h_parentPx_daughtersPx; - delete h_parentPy_daughtersPy; - delete h_parentPz_daughtersPz; - delete h_parentE_daughtersE; - delete h_recoPFOLinkedToElectron_Type; - delete h_recoPFOLinkedToMuon_Type; - delete h_SLDecayFlavour; - delete h_SLDecayModeB; - delete h_SLDecayModeC; - delete h_SLDecayOrder; - delete h_foundVertex; - delete h_secondaryVertex; - delete h_parentHadronCharge; - delete h_MCPTracks; - delete h_MCPTracks_Eweighted; - delete h_MCPTracks_Ptweighted; - delete h_FlightDirectionError; - delete h_distRecoLeptonToDownStreamVertex; + delete m_pTFile; } }