]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
A new option: "-fitTracks2Vertex" fills constrained track parameters, the default...
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Oct 2009 08:03:43 +0000 (08:03 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Oct 2009 08:03:43 +0000 (08:03 +0000)
--This line, and those below, will be ignored-.

M    global/AliHLTVertexer.cxx
M    global/AliHLTGlobalEsdConverterComponent.cxx
M    global/AliHLTVertexer.h
M    global/AliHLTGlobalEsdConverterComponent.h

HLT/global/AliHLTGlobalEsdConverterComponent.cxx
HLT/global/AliHLTGlobalEsdConverterComponent.h
HLT/global/AliHLTVertexer.cxx
HLT/global/AliHLTVertexer.h

index 4283ea7bc77d9a28b4e528b4c2a026c41ff3cb77..6f9d855a6d62c03d5b6ee799411eb3d92bf5bf53 100644 (file)
@@ -56,6 +56,7 @@ AliHLTGlobalEsdConverterComponent::AliHLTGlobalEsdConverterComponent()
   , fVerbosity(0)
   , fESD(NULL)
   , fSolenoidBz(-5.00668)
+  , fFillVtxConstrainedTracks( 0 )
 {
   // see header file for class documentation
   // or
@@ -92,6 +93,12 @@ int AliHLTGlobalEsdConverterComponent::Configure(const char* arguments)
        HLTInfo("Magnetic Field set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
        fSolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof();
        continue;
+      }
+      else if (argument.CompareTo("-fitTracks2Vertex")==0) {
+       if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+       HLTInfo("Filling of vertex constrained tracks is set set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+       fFillVtxConstrainedTracks=((TObjString*)pTokens->At(i))->GetString().Atoi();
+       continue;
       } else {
        HLTError("unknown argument %s", argument.Data());
        iResult=-EINVAL;
@@ -423,6 +430,14 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
       vertexer.SetESD( pESD );
       vertexer.FindPrimaryVertex();
       vertexer.FindV0s();
+
+      // relate the tracks to vertex
+      if( fFillVtxConstrainedTracks ){
+       for( Int_t i = 0; i<pESD->GetNumberOfTracks(); i++){
+         if( !vertexer.TrackInfos()[i].fPrimUsedFlag ) continue;
+         pESD->GetTrack(i)->RelateToVertex( pESD->GetPrimaryVertex(), fESD->GetMagneticField(),5. );
+       }
+      }
       
       if (iAddedDataBlocks>0 && pTree) {
        pTree->Fill();
index 415cdae01bcfd7abc7ab1b69cd4c6fd4bce09a7d..9a4b96bb3e9f1c46f7079e1488f5d33e1870c29f 100644 (file)
@@ -102,6 +102,9 @@ protected:
   /// solenoid b field
   Double_t fSolenoidBz; //! transient
 
+  /// fill track parameters, constrained to vertex
+  Bool_t fFillVtxConstrainedTracks; //! transient
+
   ClassDef(AliHLTGlobalEsdConverterComponent, 0)
 };
 #endif
index 5824184c3f43eb0306eaa7f9692ad0b62e8cf776..39e0caeab80b31c09158e971115ad7da25e0c7ad 100644 (file)
@@ -46,7 +46,7 @@ void AliHLTVertexer::SetESD( AliESDEvent *event )
 
   delete[] fTrackInfos;
   fESD = event;
-  std::cout<<"vertexer field = "<<-fESD->GetMagneticField() <<std::endl;
+
   AliKFParticle::SetField( -fESD->GetMagneticField() );
 
   Int_t nESDTracks=event->GetNumberOfTracks(); 
@@ -105,7 +105,12 @@ void AliHLTVertexer::FindPrimaryVertex(  )
   if( fPrimaryVtx.GetNContributors()>3 ){
     AliESDVertex vESD( fPrimaryVtx.Parameters(), fPrimaryVtx.CovarianceMatrix(), fPrimaryVtx.GetChi2(), fPrimaryVtx.GetNContributors() );
     fESD->SetPrimaryVertexTracks( &vESD );
+  } else {
+    for( Int_t i = 0; i<nTracks; i++)
+      fTrackInfos[i].fPrimUsedFlag = 0;
   }
+
+
   delete[] vSelected;
   delete[] vIndex;
   delete[] vFlag;
index c48a5486912c9ae9f104beb2b6576eeae59f8976..3cfa5972014855ab2deb070707ca359f2be0f07b 100644 (file)
@@ -31,9 +31,9 @@ public:
   virtual ~AliHLTVertexer(){ delete[] fTrackInfos; }
 
   void SetESD( AliESDEvent *event );
-
   void FindPrimaryVertex();
   void FindV0s();
+  const AliESDTrackInfo *TrackInfos(){ return fTrackInfos; }  
 
  private: