LCOV - code coverage report
Current view: top level - ITSMFT/MFT/MFTrec - AliMFTReconstructor.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 60 1.7 %
Date: 2016-06-14 17:26:59 Functions: 1 13 7.7 %

          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             : //====================================================================================================================================================
      17             : //
      18             : //      Event reconstruction class for the ALICE Muon Forward Tracker
      19             : //
      20             : //      Contact author: antonio.uras@cern.ch
      21             : //
      22             : //====================================================================================================================================================
      23             : 
      24             : #include "TObjArray.h"
      25             : #include "TTree.h"
      26             : #include "AliMFTSegmentation.h"
      27             : #include "AliMFTClusterFinder.h"
      28             : #include "AliReconstructor.h"
      29             : #include "AliMFTGeometry.h"
      30             : #include "AliMFTReconstructor.h"
      31             : 
      32          12 : ClassImp(AliMFTReconstructor)
      33             : 
      34             : //====================================================================================================================================================
      35             : 
      36             : AliMFTReconstructor::AliMFTReconstructor():
      37           0 :   AliReconstructor(), 
      38           0 :   fDigits(0x0){
      39             : 
      40             :   // default constructor 
      41             : 
      42           0 : }
      43             : 
      44             : //====================================================================================================================================================
      45             : 
      46           0 : AliMFTReconstructor::~AliMFTReconstructor() {
      47             :   
      48             :   // destructor
      49             :   
      50           0 :   if (fDigits) {
      51           0 :     for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
      52           0 :       if (fDigits->At(iPlane)) fDigits->At(iPlane)->Delete();
      53             :     }
      54           0 :     fDigits->Delete();
      55           0 :     delete fDigits;
      56           0 :     fDigits=0;
      57           0 :   }
      58             :   
      59           0 : }
      60             : 
      61             : //====================================================================================================================================================
      62             : 
      63             : void AliMFTReconstructor::Clear(const Option_t* /*opt*/) {
      64             :         
      65             :   // Clear arrays
      66             :   
      67           0 :   if (fDigits) {
      68           0 :     for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
      69           0 :       if (fDigits->At(iPlane)) ((TClonesArray*)fDigits->At(iPlane))->Delete();
      70             :     }
      71           0 :     fDigits->Delete();
      72           0 :     delete fDigits;
      73           0 :     fDigits = NULL;
      74           0 :   }
      75             :   
      76           0 : }
      77             : 
      78             : //====================================================================================================================================================
      79             : 
      80             : void AliMFTReconstructor::Init() {
      81             : 
      82           0 :   AliMFTGeometry* mftGeom =   AliMFTGeometry::Instance();
      83           0 :   mftGeom->LoadSegmentation();
      84             :   
      85             : 
      86           0 :   fDigits = new TObjArray(AliMFTConstants::kNDisks);
      87           0 :   fDigits->SetOwner(kTRUE);
      88           0 :   for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
      89           0 :     fDigits->AddAt(new TClonesArray("AliMFTDigit"),iPlane);
      90           0 :     ((TClonesArray*)fDigits->At(iPlane))->SetOwner(kTRUE);
      91             :   }
      92             :   
      93           0 :   AliInfo(" ************* Using the MFT reconstructor! ************ ");
      94             :   
      95             :   return;
      96             : 
      97           0 : }
      98             : 
      99             : //====================================================================================================================================================
     100             : 
     101             : void AliMFTReconstructor::ResetDigits() {
     102             : 
     103             :   // Reset number of digits and the digits array for the MFT detector.
     104             : 
     105           0 :   if (!fDigits) return;
     106           0 :   for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
     107           0 :     ResetDigits(iPlane);
     108             :   }
     109             : 
     110           0 : }
     111             : 
     112             : //====================================================================================================================================================
     113             : 
     114             : void AliMFTReconstructor::ResetDigits(Int_t plane) {
     115             : 
     116             :   // Reset number of digits and the digits array for this branch.
     117             : 
     118           0 :   if (fDigits->At(plane)) ((TClonesArray*)fDigits->At(plane))->Clear();
     119             : 
     120           0 : }
     121             : 
     122             : //====================================================================================================================================================
     123             : 
     124             : void AliMFTReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const {
     125             : 
     126           0 :   AliInfo("Starting Reconstruction for MFT");
     127             : 
     128             :   // Clusterization
     129             : 
     130           0 :   for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
     131           0 :     AliDebug(1, Form("Setting Address for Branch Plane_%02d", iPlane)); 
     132           0 :     digitsTree->SetBranchAddress(Form("Plane_%02d",iPlane), &(*fDigits)[iPlane]);
     133             :   }
     134             :  
     135           0 :   digitsTree->GetEntry(0);
     136             : 
     137           0 :   AliDebug(1, "Creating clusterFinder");
     138           0 :   AliMFTClusterFinder *clusterFinder = new AliMFTClusterFinder();
     139           0 :   clusterFinder->ApplyMisalignment(kTRUE);    // only in case of MC !!!
     140           0 :   clusterFinder->Init("");
     141           0 :   clusterFinder->MakeClusterBranch(clustersTree);
     142           0 :   clusterFinder->SetClusterTreeAddress(clustersTree);
     143           0 :   clusterFinder->DigitsToClusters(fDigits);
     144           0 :   clustersTree->Fill();                         // fill tree for current event
     145           0 :   delete clusterFinder;
     146             : 
     147           0 :   for (Int_t iPlane=0; iPlane<AliMFTConstants::kNDisks; iPlane++) {
     148           0 :     AliDebug(1, Form("fDigits->At(%d)->Clear()",iPlane));
     149           0 :     ((TClonesArray*)fDigits->At(iPlane))->Delete();
     150             :   }
     151             : 
     152           0 : }
     153             : 
     154             : //====================================================================================================================================================
     155             : 
     156             : AliTracker* AliMFTReconstructor::CreateTracker() const {
     157           0 :   AliInfo("CreateTracker");
     158             : 
     159             :   // Create a MFT tracker: global MUON+MFT tracks
     160             : 
     161             :   // AliMFTTrackerMU *tracker = new AliMFTTrackerMU();   // tracker for muon tracks (MFT + MUON)
     162           0 :   AliMFTTracker *tracker = new AliMFTTracker();   // tracker for MFT tracks
     163             : 
     164           0 :   return tracker;
     165             :   
     166           0 : }
     167             : 
     168             : //====================================================================================================================================================
     169             : 
     170             : AliTracker* AliMFTReconstructor::CreateTrackleter() const {
     171             : 
     172           0 :   AliInfo("Not implemented");
     173             : 
     174             :   // Create a MFT tracker: standalone MFT tracks
     175             : 
     176             :   //  AliMFTTrackerSA *tracker = new AliMFTTrackerSA();   // tracker for MFT tracks
     177             : 
     178           0 :   return NULL;
     179             :   
     180             : }
     181             : 
     182             : //====================================================================================================================================================
     183             : 

Generated by: LCOV version 1.11