LCOV - code coverage report
Current view: top level - FMD/FMDrec - AliFMDReconstructor.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 7 57.1 %
Date: 2016-06-14 17:26:59 Functions: 5 11 45.5 %

          Line data    Source code
       1             : #ifndef ALIFMDRECONSTRUCTOR_H
       2             : #define ALIFMDRECONSTRUCTOR_H
       3             : //
       4             : //  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
       5             : //  reserved. 
       6             : //
       7             : //  See cxx source for full Copyright notice                               
       8             : //
       9             : //  AliFMDReconstructor.h 
      10             : //  Task Class for making TreeR for FMD                        
      11             : //
      12             : //-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
      13             : //   Latest changes by Christian Holm Christensen <cholm@nbi.dk>
      14             : /* $Id$ */
      15             : /** @file    AliFMDReconstructor.h
      16             :     @author  Christian Holm Christensen <cholm@nbi.dk>
      17             :     @date    Mon Mar 27 12:47:09 2006
      18             :     @brief   FMD reconstruction 
      19             : */
      20             : 
      21             : //____________________________________________________________________
      22             : // Header guards in the header files speeds up the compilation
      23             : // considerably.  Please leave them in. 
      24             : #ifndef ALIRECONSTRUCTOR_H
      25             : # include <AliReconstructor.h>
      26             : #endif
      27             : #include "AliLog.h"
      28             : #include <AliFMDBoolMap.h>
      29             : 
      30             : //____________________________________________________________________
      31             : class TTree;
      32             : class TClonesArray;
      33             : class AliFMDDigit;
      34             : class AliRawReader;
      35             : class AliFMDRawReader;
      36             : class AliESDEvent;
      37             : class AliESDFMD;
      38             : class AliFMDRecoParam;
      39             : class TH1;
      40             : 
      41             : 
      42             : /** @defgroup FMD_rec Reconstruction */
      43             : //____________________________________________________________________
      44             : /** 
      45             :  * @brief This is a class that reconstructs AliFMDRecPoint objects
      46             :  *        from of Digits.  
      47             :  *
      48             :  * This class reads either digits from a TClonesArray or raw data
      49             :  * from a DDL file (or similar), and applies calibrations to get
      50             :  * psuedo-inclusive multiplicities per strip.
      51             :  * 
      52             :  * @ingroup FMD_rec
      53             :  */
      54             : class AliFMDReconstructor: public AliReconstructor 
      55             : {
      56             : public:
      57             :   /** 
      58             :    * CTOR 
      59             :    */
      60             :   AliFMDReconstructor();
      61             :   /** 
      62             :    * DTOR 
      63             :    */
      64             :   virtual ~AliFMDReconstructor();
      65             : 
      66             :   /** 
      67             :    * Initialize the reconstructor.  Here, we initialize the geometry
      68             :    * manager, and finds the local to global transformations from the
      69             :    * geometry.   The calibration parameter manager is also
      70             :    * initialized (meaning that the calibration parameters is read
      71             :    * from CDB).
      72             :    */
      73             :   virtual void   Init();
      74             :   /** 
      75             :    * Flag that we can convert raw data into digits. 
      76             :    *
      77             :    * @return always @c true 
      78             :    */
      79          24 :   virtual Bool_t HasDigitConversion() const { return kTRUE; }
      80             :   /** 
      81             :    * Convert raw data read from the AliRawReader @a reader into
      82             :    * digits.  This is done using AliFMDRawReader and
      83             :    * AliFMDAltroReader.  The digits are put in the passed TTree @a
      84             :    * digitsTree. 
      85             :    *
      86             :    * @note This is the first part of the reconstruction as done by the
      87             :    * offical steering class AliReconstruction.
      88             :    *
      89             :    * @param reader Raw reader.  @param digitsTree Tree to store read
      90             :    * digits in.
      91             :    */
      92             :   virtual void   ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
      93             :   /** 
      94             :    * Reconstruct one event from the digits passed in @a digitsTree.
      95             :    * The member function creates AliFMDRecPoint objects and stores
      96             :    * them on the output tree @a clusterTree.  An FMD ESD object is
      97             :    * created in parallel. 
      98             :    *
      99             :    * @note This is the second part of the reconstruction as done by
     100             :    * the offical steering class AliReconstruction.
     101             :    *
     102             :    * @param digitsTree  Tree holding the digits of this event
     103             :    * @param clusterTree Tree to store AliFMDRecPoint objects in. 
     104             :    */
     105             :   virtual void   Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
     106             :   /** 
     107             :    * Not used 
     108             :    * @todo Implement this, such that we'll reconstruct directly from
     109             :    *       the read ADC values rather than going via an intermedant
     110             :    *       TClonesArray of AliFMDDigits
     111             :    */
     112             :   virtual void   Reconstruct(AliRawReader *, TTree*) const;
     113             :   /** 
     114             :    * Not used.
     115             :    *
     116             :    * @todo This is called by the above same member function but with a
     117             :    * pointer to a AliRawReader object and a pointer to a TTree object.
     118             :    *
     119             :    * @param reader Reader object 
     120             :    */
     121             :   virtual void Reconstruct(AliFMDRawReader& reader) const;
     122             :   /** 
     123             :    * Put in the ESD data, the FMD ESD data.  The object created by
     124             :    * the Reconstruct member function is copied to the ESD object. 
     125             :    *
     126             :    * @note This is the third part of the reconstruction as done by
     127             :    * the offical steering class AliReconstruction.
     128             :    *
     129             :    * @param digitsTree   Tree of digits for this event - not used
     130             :    * @param clusterTree  Tree of reconstructed points for this event -
     131             :    *        not used.
     132             :    * @param esd ESD object to store data in. 
     133             :    */
     134             :   virtual void   FillESD(TTree* digitsTree, TTree* clusterTree, 
     135             :                          AliESDEvent* esd) const;
     136             :   /** 
     137             :    * Forwards to above member function 
     138             :    */
     139             :   virtual void   FillESD(AliRawReader*, TTree* clusterTree, 
     140             :                          AliESDEvent* esd) const;
     141             :   /** 
     142             :    * Return the filled FMD ESD object
     143             :    * 
     144             :    * @return FMD ESD object
     145             :    */
     146           0 :   AliESDFMD* GetESDObject() const { return fESDObj; }
     147             :   /** 
     148             :    * Create SDigits from raw data
     149             :    * 
     150             :    * @param reader  The raw reader
     151             :    * @param sdigits Array to fill with AliFMDSDigit objects. 
     152             :    */  
     153             :   virtual void Digitize(AliRawReader* reader, 
     154             :                         TClonesArray* sdigits) const;
     155             :   
     156             :   /** 
     157             :    * Not used 
     158             :    */
     159           0 :   virtual void   SetESD(AliESDEvent* esd) { fESD = esd; }
     160             :   /** 
     161             :    * Set the noise factor 
     162             :    *
     163             :    * @param f Factor to use 
     164             :    */
     165           4 :   virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
     166             :   /** 
     167             :    * Set whether we should do angle correction or nor 
     168             :    *
     169             :    * @param use If true, do angle correction 
     170             :    */
     171           2 :   virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
     172             :   /** 
     173             :    * Set whether we want to do diagnostics.  If this is enabled, a
     174             :    * file named @c FMD.Diag.root will be made.  It contains a set of
     175             :    * histograms for each event, filed in separate directories in the
     176             :    * file.  The histograms are 
     177             :    * @verbatim 
     178             :    * diagStep1   Read ADC vs. Noise surpressed ADC 
     179             :    * diagStep2   Noise surpressed ADC vs. calculated Energy dep.
     180             :    * diagStep3   Energy deposition vs. angle corrected Energy dep.
     181             :    * diagStep4   Energy deposition vs. calculated multiplicity
     182             :    * diagAll     Read ADC vs. calculated multiplicity
     183             :    * @endverbatim 
     184             :    *
     185             :    * @param use If true, make the diagnostics file 
     186             :    */
     187           0 :   void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
     188             :   /** 
     189             :    * Process AliFMDDigit objects in @a digits.  For each digit, find
     190             :    * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
     191             :    * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
     192             :    * M@f$.
     193             :    * 
     194             :    * @param digits  Array of digits. 
     195             :    * @param rawRead Raw reader used 
     196             :    */
     197             :   virtual void ProcessDigits(TClonesArray* digits,
     198             :                              const AliFMDRawReader& rawRead) const;
     199             :     
     200             : protected:
     201             :   /** 
     202             :    * Copy CTOR 
     203             :    *
     204             :    * @param other Object to copy from. 
     205             :    */
     206             :   AliFMDReconstructor(const AliFMDReconstructor&); //Not implemented
     207             :   /** 
     208             :    * Assignment operator 
     209             :    *
     210             :    * @param other Object to assign from
     211             :    *
     212             :    * @return reference to this object 
     213             :    */
     214             :   AliFMDReconstructor& operator=(const AliFMDReconstructor&); //Not implemented
     215             :   /** 
     216             :    * Run some checks before reconstruction, clear internal arrays, etc. 
     217             :    * 
     218             :    * @return true on success 
     219             :    */
     220             :   Bool_t PreReconstruct() const;
     221             :   /** 
     222             :    * Try to get the vertex from either ESD or generator header.  Sets
     223             :    * @c fCurrentVertex to the found Z posistion of the vertex (if 
     224             :    * found), and sets the flag @c fVertexType accordingly 
     225             :    *
     226             :    * @param esd ESD structure to get Vz from
     227             :    */
     228             :   virtual void GetVertex(AliESDEvent* esd) const;
     229             :   /** 
     230             :    * Set-up reconstructor to use values from reconstruction
     231             :    * parameters, if present, for this event.   If the argument @a set
     232             :    * is @c false, then restore preset values. 
     233             :    * 
     234             :    * @param set 
     235             :    */  
     236             :   virtual void UseRecoParam(Bool_t set=kTRUE) const;
     237             :   /** 
     238             :    * Process AliFMDDigit objects in @a digits.  For each digit, find
     239             :    * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
     240             :    * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
     241             :    * M@f$.
     242             :    * 
     243             :    * @param digits Array of digits. 
     244             :    */
     245             :   virtual void ProcessDigits(TClonesArray* digits) const;
     246             :   /** 
     247             :    * Process a single digit 
     248             :    * 
     249             :    * @param digit Digiti to process
     250             :    */ 
     251             :   virtual void ProcessDigit(AliFMDDigit* digit) const;
     252             :   /** 
     253             :    * Process the signal from a single strip. 
     254             :    * 
     255             :    * @param det Detector number 
     256             :    * @param rng Ring identifier 
     257             :    * @param sec Sector number
     258             :    * @param str Strip number 
     259             :    * @param adc Number of ADC counts for this strip
     260             :    */  
     261             :   virtual void ProcessSignal(UShort_t det, 
     262             :                              Char_t   rng, 
     263             :                              UShort_t sec, 
     264             :                              UShort_t str, 
     265             :                              Short_t  adc) const;
     266             :   /** 
     267             :    * Process the signal from a single strip. 
     268             :    * 
     269             :    * @param sdigits Array to fill
     270             :    * @param det     Detector number 
     271             :    * @param rng     Ring identifier 
     272             :    * @param sec     Sector number
     273             :    * @param str     Strip number 
     274             :    * @param sam     Sample number 
     275             :    * @param adc     Number of ADC counts for this strip
     276             :    */  
     277             :   virtual void DigitizeSignal(TClonesArray* sdigits, 
     278             :                               UShort_t      det, 
     279             :                               Char_t         rng, 
     280             :                               UShort_t       sec, 
     281             :                               UShort_t       str, 
     282             :                               UShort_t       sam,
     283             :                               Short_t        adc) const;
     284             :   /** 
     285             :    * Subtract the pedestal off the ADC counts. 
     286             :    * 
     287             :    * @param det           Detector number
     288             :    * @param rng           Ring identifier
     289             :    * @param sec           Sector number
     290             :    * @param str           Strip number
     291             :    * @param adc           ADC counts
     292             :    * @param noiseFactor   If pedestal substracted pedestal is less then
     293             :    *        this times the noise, then consider this to be 0. 
     294             :    * @param zsEnabled     Whether zero-suppression is on.
     295             :    * @param zsNoiseFactor Noise factor used in on-line pedestal
     296             :    *        subtraction. 
     297             :    * 
     298             :    * @return The pedestal subtracted ADC counts (possibly 0), or @c
     299             :    *         USHRT_MAX in case of problems.
     300             :    */  
     301             :   virtual UShort_t SubtractPedestal(UShort_t det, 
     302             :                                     Char_t   rng, 
     303             :                                     UShort_t sec, 
     304             :                                     UShort_t str, 
     305             :                                     UShort_t adc, 
     306             :                                     Float_t  noiseFactor,
     307             :                                     Bool_t   zsEnabled, 
     308             :                                     UShort_t zsNoiseFactor) const;
     309             :   /** 
     310             :    * Substract pedestals from raw ADC in @a digit
     311             :    * 
     312             :    * @param det   Detector number  
     313             :    * @param rng   Ring identifier 
     314             :    * @param sec   Sector number
     315             :    * @param str   Strip number 
     316             :    * @param adc   Number of ADC counts
     317             :    *
     318             :    * @return Pedestal subtracted ADC count. 
     319             :    */
     320             :   virtual UShort_t SubtractPedestal(UShort_t det, 
     321             :                                     Char_t   rng, 
     322             :                                     UShort_t sec, 
     323             :                                     UShort_t str, 
     324             :                                     Short_t  adc) const;
     325             :   /** 
     326             :    * Converts number of ADC counts to energy deposited.   This is
     327             :    * done by 
     328             :    * @f[
     329             :    * E_i = A_i g_i
     330             :    * @f]
     331             :    * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
     332             :    * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip. 
     333             :    * 
     334             :    * @param det   Detector number  
     335             :    * @param rng   Ring identifier 
     336             :    * @param sec   Sector number
     337             :    * @param str   Strip number 
     338             :    * @param eta   Psuedo-rapidity of digit.
     339             :    * @param count Pedestal subtracted ADC counts
     340             :    *
     341             :    * @return Energy deposited @f$ E_i@f$ 
     342             :    */
     343             :   virtual Float_t  Adc2Energy(UShort_t det, 
     344             :                               Char_t   rng, 
     345             :                               UShort_t sec, 
     346             :                               UShort_t str, 
     347             :                               UShort_t count) const;
     348             :   /** 
     349             :    * Converts number of ADC counts to energy deposited.   This is
     350             :    * done by 
     351             :    * @f[
     352             :    * E_i = A_i g_i
     353             :    * @f]
     354             :    * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
     355             :    * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip. 
     356             :    * 
     357             :    * @param det   Detector number  
     358             :    * @param rng   Ring identifier 
     359             :    * @param sec   Sector number
     360             :    * @param str   Strip number 
     361             :    * @param eta   Psuedo-rapidity of digit.
     362             :    * @param count Pedestal subtracted ADC counts
     363             :    *
     364             :    * @return Energy deposited @f$ E_i@f$ 
     365             :    */
     366             :   virtual Float_t  Adc2Energy(UShort_t det, 
     367             :                               Char_t   rng, 
     368             :                               UShort_t sec, 
     369             :                               UShort_t str, 
     370             :                               Float_t  eta, 
     371             :                               UShort_t count) const;
     372             :   /** 
     373             :    * Converts an energy signal to number of particles. In this
     374             :    * implementation, it's done by 
     375             :    * @f[
     376             :    * M_i = E_i / E_{\mbox{MIP}}
     377             :    * @f]
     378             :    * where @f$ E_i@f$ is the energy deposited, and 
     379             :    * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
     380             :    * minimum ionizing particle
     381             :    * 
     382             :    * @param det   Detector number  
     383             :    * @param rng   Ring identifier 
     384             :    * @param sec   Sector number
     385             :    * @param str   Strip number 
     386             :    * @param eta   On return, psuedo-rapidity @f$ \eta@f$
     387             :    * @param phi   On return, azimuthal angle @f$ \varphi@f$ 
     388             :    * @param edep Energy deposited @f$ E_i@f$
     389             :    *
     390             :    * @return Psuedo-inclusive multiplicity @f$ M@f$ 
     391             :    */
     392             :   virtual Float_t  Energy2Multiplicity(UShort_t det, 
     393             :                                        Char_t   rng, 
     394             :                                        UShort_t sec, 
     395             :                                        UShort_t str, 
     396             :                                        Float_t  edep) const;
     397             :   /** 
     398             :    * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
     399             :    * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
     400             :    * the digit @a digit.   This is done by using the information
     401             :    * obtained, and previously cached by AliFMDGeometry, from the
     402             :    * TGeoManager. 
     403             :    * 
     404             :    * @param det   Detector number  
     405             :    * @param rng   Ring identifier 
     406             :    * @param sec   Sector number
     407             :    * @param str   Strip number 
     408             :    * @param eta   On return, psuedo-rapidity @f$ \eta@f$
     409             :    * @param phi   On return, azimuthal angle @f$ \varphi@f$ 
     410             :    */
     411             :   virtual void     PhysicalCoordinates(UShort_t det, 
     412             :                                        Char_t   rng, 
     413             :                                        UShort_t sec, 
     414             :                                        UShort_t str, 
     415             :                                        Float_t& eta, 
     416             :                                        Float_t& phi) const;
     417             :   /** 
     418             :    * Mark dead channels as invalid, and those that are marked as invalid 
     419             :    * but are not dead, get the zero signal. 
     420             :    * 
     421             :    * @param esd ESD object to modify. 
     422             :    */
     423             :   void MarkDeadChannels(AliESDFMD* esd) const;
     424             : 
     425             :   /** 
     426             :    * Utility member function to get the reconstruction parameters for 
     427             :    * this event
     428             :    * 
     429             :    * @return Pointer to AliFMDRecoParam object or null if not
     430             :    * available. 
     431             :    */
     432             :   const AliFMDRecoParam* GetParameters() const;
     433             :   /** 
     434             :    * Get the numeric identifier of this detector
     435             :    * 
     436             :    * @return Should be 12
     437             :    */  
     438             :   Int_t GetIdentifier() const;
     439             :   enum Vertex_t {
     440             :     kNoVertex,   // Got no vertex
     441             :     kGenVertex,  // Got generator vertex 
     442             :     kESDVertex   // Got ESD vertex 
     443             :   };
     444             :   mutable TClonesArray* fMult;          // Cache of RecPoints
     445             :   mutable Int_t         fNMult;         // Number of entries in fMult 
     446             :   mutable TTree*        fTreeR;         // Output tree 
     447             :   mutable Float_t       fCurrentVertex; // Z-coordinate of primary vertex
     448             :   mutable AliESDFMD*    fESDObj;        // ESD output object
     449             :   mutable Float_t       fNoiseFactor;   // Factor of noise to check
     450             :   mutable Bool_t        fAngleCorrect;  // Whether to angle correct
     451             :   mutable Vertex_t      fVertexType;    // What kind of vertex we got
     452             :   AliESDEvent*          fESD;           // ESD object(?)
     453             :   Bool_t                fDiagnostics;   // Wheter to do diagnostics
     454             :   TH1*                  fDiagStep1;     // Diagnostics histogram
     455             :   TH1*                  fDiagStep2;     // Diagnostics histogram
     456             :   TH1*                  fDiagStep3;     // Diagnostics histogram
     457             :   TH1*                  fDiagStep4;     // Diagnostics histogram
     458             :   TH1*                  fDiagAll;       // Diagnostics histogram
     459             :   mutable Bool_t        fZS[3];         // Zero-suppredded?
     460             :   mutable UShort_t      fZSFactor[3];   // Noise factor for Zero-suppression
     461             :   mutable AliFMDBoolMap fBad;           // Strip marked bad
     462             :   Bool_t                fZombie;        // Are we a zombie?
     463             : private:
     464             :    
     465     2618954 :   ClassDef(AliFMDReconstructor, 3)  // class for the FMD reconstruction
     466             : }; 
     467             : #endif
     468             : //____________________________________________________________________
     469             : //
     470             : // Local Variables:
     471             : //   mode: C++
     472             : // End:
     473             : //
     474             : // EOF
     475             : //

Generated by: LCOV version 1.11