LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITSReconstructor.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 79 120 65.8 %
Date: 2016-06-14 17:26:59 Functions: 14 14 100.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : ///////////////////////////////////////////////////////////////////////////////
      19             : //                                                                           //
      20             : // class for ITS reconstruction                                              //
      21             : //                                                                           //
      22             : ///////////////////////////////////////////////////////////////////////////////
      23             : 
      24             : #include "Riostream.h"
      25             : #include "AliITSReconstructor.h"
      26             : #include "AliRun.h"
      27             : #include "AliRawReader.h"
      28             : #include "AliESDEvent.h"
      29             : #include "AliESDpid.h"
      30             : #include "AliITSgeom.h"
      31             : #include "AliITSLoader.h"
      32             : #include "AliITStrackerMI.h"
      33             : #include "AliITStrackerV2.h"
      34             : #include "AliITStrackerSA.h"
      35             : #include "AliITSVertexerFast.h"
      36             : #include "AliITSVertexerFixed.h"
      37             : #include "AliITSVertexer3D.h"
      38             : #include "AliITSVertexerZ.h"
      39             : #include "AliITSVertexerZD.h"
      40             : #include "AliITSVertexerCosmics.h"
      41             : #include "AliITSInitGeometry.h"
      42             : #include "AliITSMultReconstructor.h"
      43             : 
      44         118 : ClassImp(AliITSReconstructor)
      45             : 
      46             : 
      47             : Bool_t AliITSReconstructor::fgkCheckInvariant = kTRUE;
      48             : 
      49             : //___________________________________________________________________________
      50           2 : AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
      51           2 : fDetTypeRec(0)
      52          10 : {
      53             :   // Default constructor
      54           4 : }
      55             :  //___________________________________________________________________________
      56          12 : AliITSReconstructor::~AliITSReconstructor(){
      57             : // destructor
      58           6 :   if(fDetTypeRec) delete fDetTypeRec;
      59           6 : } 
      60             : //____________________________________________________________________________
      61             : void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
      62             :   //
      63             :   // pass PID settings from AliITSRecoParam to AliESDpid
      64             :   //
      65          16 :   Int_t pidOpt = GetRecoParam()->GetPID();
      66             : 
      67          16 :   if(pidOpt==1){
      68           8 :     AliDebug(1,"ITS LandauFitPID option has been selected\n");
      69           0 :     ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
      70           0 :   }
      71             :   else{
      72          24 :     AliDebug(1,"ITS default PID\n");
      73           8 :     ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
      74             :   }
      75           8 : }
      76             : //______________________________________________________________________
      77             : void AliITSReconstructor::Init() {
      78             :     // Initalize this constructor bet getting/creating the objects
      79             :     // nesseary for a proper ITS reconstruction.
      80             :     // Inputs:
      81             :     //   none.
      82             :     // Output:
      83             :     //   none.
      84             :     // Return:
      85             :     //   none.
      86             : 
      87           4 :     AliITSInitGeometry initgeom;
      88           2 :     AliITSgeom *geom = initgeom.CreateAliITSgeom();
      89          12 :     AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
      90             : 
      91           6 :     fDetTypeRec = new AliITSDetTypeRec();
      92           2 :     fDetTypeRec->SetITSgeom(geom);
      93           2 :     fDetTypeRec->SetDefaults();
      94             : 
      95             :     return;
      96           2 : }
      97             : 
      98             : //_____________________________________________________________________________
      99             : void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
     100             : {
     101             : // reconstruct clusters
     102             : 
     103           8 :   TString recopt = GetRecoParam()->GetOptReco();
     104           4 :   fDetTypeRec->SetTreeAddressD(digitsTree);
     105           4 :   fDetTypeRec->MakeBranch(clustersTree,"R");
     106           4 :   fDetTypeRec->SetTreeAddressR(clustersTree);
     107           8 :   fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,recopt.Data(),1);    
     108           4 : }
     109             : 
     110             : //_________________________________________________________________
     111             : void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
     112             : {
     113             :   // reconstruct clusters from raw data
     114           8 :   TString recopt = GetRecoParam()->GetOptReco();
     115           4 :   fDetTypeRec->SetDefaultClusterFindersV2(kTRUE,kTRUE);
     116           8 :   fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,recopt.Data());
     117           4 : }
     118             : 
     119             : //_____________________________________________________________________________
     120             : AliTrackleter* AliITSReconstructor::CreateMultFinder() const
     121             : {
     122             :   // create the SPD trackeleter for mult. reconstruction
     123          16 :   AliITSMultReconstructor* multReco = new AliITSMultReconstructor();
     124           8 :   multReco->SetHistOn(kFALSE);
     125           8 :   multReco->SetDetTypeRec(fDetTypeRec);
     126           8 :   return multReco;
     127           0 : }
     128             : 
     129             : //_____________________________________________________________________________
     130             : AliTracker* AliITSReconstructor::CreateTracker() const
     131             : {
     132             : // create a ITS tracker
     133             : 
     134           4 :   Int_t trackerOpt = GetRecoParam()->GetTracker();
     135             :   AliTracker* tracker;    
     136           2 :   if (trackerOpt==1) {
     137           0 :     tracker = new AliITStrackerMI(0);
     138           0 :     AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
     139           0 :     mit->SetDetTypeRec(fDetTypeRec);
     140           0 :   }  
     141           2 :   else if (trackerOpt==2) {
     142           0 :     tracker = new AliITStrackerV2(0);
     143           0 :   }
     144             :   else {
     145           4 :     tracker =  new AliITStrackerSA(0);  // inherits from AliITStrackerMI
     146           2 :     AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
     147           2 :     sat->SetDetTypeRec(fDetTypeRec);
     148           2 :     if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
     149           2 :     if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
     150           2 :         if(GetRecoParam()->GetInwardFindingSA()){
     151           0 :        sat->SetInwardFinding();
     152           0 :        sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
     153           0 :         }else{
     154           2 :       sat->SetOutwardFinding();
     155           2 :       sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
     156             :         }
     157           2 :     sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
     158             :   }
     159             : 
     160           2 :   return tracker;
     161             :   
     162           0 : }
     163             : 
     164             : //_____________________________________________________________________________
     165             : AliVertexer* AliITSReconstructor::CreateVertexer() const
     166             : {
     167             : // create a ITS vertexer
     168             : 
     169             :   AliITSVertexer *vptr = NULL;
     170          16 :   Int_t vtxOpt = GetRecoParam()->GetVertexer();
     171           8 :   if(vtxOpt==3){
     172           0 :     AliFatal("Option AliITSVertexerIons is no longer supported");
     173           0 :     return vptr;
     174             :   }
     175           8 :   else if(vtxOpt==4){
     176           0 :     Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
     177           0 :                        GetRecoParam()->GetVertexerFastSmearY(),
     178           0 :                        GetRecoParam()->GetVertexerFastSmearZ()};
     179           0 :     AliDebug(1,"AliITSVertexerFast has been selected"); 
     180           0 :     vptr = new AliITSVertexerFast(smear);
     181           0 :   }
     182           8 :   else if(vtxOpt==1){
     183           0 :     AliDebug(1,"AliITSVertexerZ has been selected");
     184           0 :     AliITSVertexerZ* vtxrz =  new AliITSVertexerZ();
     185           0 :     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
     186           0 :     if(pileupAlgo==3) vtxrz->SetSearchForPileup(kFALSE);
     187           0 :     vptr = vtxrz;
     188           0 :   }
     189           8 :   else if(vtxOpt==2){
     190           0 :     AliDebug(1,"AliITSVertexerCosmics has been selected");
     191           0 :     vptr = new AliITSVertexerCosmics();
     192           0 :   }
     193           8 :   else if(vtxOpt==5){ 
     194           0 :     AliDebug(1,"Vertex is fixed in the position of the TDI\n");
     195           0 :     vptr = new AliITSVertexerFixed("TDI");
     196           0 :   }
     197           8 :   else if(vtxOpt==6){ 
     198           0 :     AliDebug(1,"Vertex is fixed in the position of the TED\n");
     199           0 :     vptr = new AliITSVertexerFixed("TED");
     200           0 :   }
     201           8 :   else if(vtxOpt==7){
     202           0 :     AliDebug(1,"VertexerZD:  reconstruction of the Z coordinate with SDD \n");
     203           0 :     AliITSVertexerZD*vtxrz = new AliITSVertexerZD();
     204           0 :     vtxrz->SetSearchForPileup(kFALSE);
     205           0 :     vptr = vtxrz;
     206           0 :   }
     207             :   else {
     208             :   // by default an AliITSVertexer3D object is instatiated
     209             :     AliITSVertexer3D*  vtxr = 
     210          16 :        new AliITSVertexer3D(GetRecoParam()->GetVertexer3DWideFiducialRegionZ());
     211           8 :     Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
     212           8 :     Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
     213           8 :     vtxr->SetWideFiducialRegion(dzw,drw);
     214           8 :     Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
     215           8 :     Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
     216           8 :     vtxr->SetNarrowFiducialRegion(dzn,drn);
     217           8 :     Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
     218           8 :     Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
     219           8 :     vtxr->SetDeltaPhiCuts(dphil,dphit);
     220           8 :     Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
     221           8 :     vtxr->SetDCACut(dcacut);
     222           8 :     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
     223           8 :     vtxr->SetPileupAlgo(pileupAlgo);
     224           8 :     UChar_t highmultAlgo=GetRecoParam()->GetSPDVertexerHighMultAlgo();
     225           8 :     vtxr->SetHighMultAlgo(highmultAlgo);
     226          24 :     AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
     227           8 :     vtxr->SetFallBack(500); // fall back to vertexerZ is SPD-0 clusters>500
     228           8 :     vptr = vtxr;
     229             :   }
     230           8 :   vptr->SetDetTypeRec(fDetTypeRec);
     231           8 :   return vptr;
     232           8 : }
     233             : 
     234             : //_____________________________________________________________________________
     235             : void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/, 
     236             :                                   AliESDEvent* /* esd */) const
     237             : {
     238             : // make PID, find V0s and cascade
     239             : /* Now done in AliESDpid
     240             :   if(fItsPID!=0) fItsPID->MakePID(esd);
     241             :   else AliError("!! cannot do the PID !!");
     242             : */
     243          16 : }

Generated by: LCOV version 1.11