ROOT logo
#ifndef ALIFMDV1_H
#define ALIFMDV1_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
 * reserved. 
 *
 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
 *
 * See cxx source for full Copyright notice                               
 */
/** @file    AliFMDv1.h
    @author  Christian Holm Christensen <cholm@nbi.dk>
    @date    Mon Mar 27 12:48:51 2006
    @brief   Concrete implementation of FMD detector driver - detailed
    version 
*/
//____________________________________________________________________
//
//  Manager class for the FMD - Detailed version. 
//  Implements the full geometry, 
//  And does stepping
// 
#ifndef ALIFMD_H 
# include "AliFMD.h"
#endif
#ifndef ROOT_TLorentzVector
# include <TLorentzVector.h>
#endif
 
//____________________________________________________________________
/** @brief Forward Multiplicity Detector based on Silicon wafers. 

    This class contains the base procedures for the Forward
    Multiplicity detector Detector consists of 3 sub-detectors FMD1,
    FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
                                                           
    This class contains the detailed version of the FMD - that is,
    hits are produced during simulation. 
    @ingroup FMD_sim
*/
class AliFMDv1 : public AliFMD 
{
public:
  /** CTOR */
  AliFMDv1()
    : AliFMD(),
      fCurrentDeltaE(0),
      fCurrentV(),
      fCurrentP(),
      fCurrentPdg(0) { fDetailed = kTRUE; }
  /** CTOR 
      @param name Name 
      @param title Title */
  AliFMDv1(const char *name, const char *title="Detailed geometry") 
    : AliFMD(name, title),
      fCurrentDeltaE(0),
      fCurrentV(),
      fCurrentP(),
      fCurrentPdg(0) { fDetailed = kTRUE; }
  /** DTOR */
  virtual ~AliFMDv1() {}

  // Required member functions 
  /** Get version number 
      @return always 1 */
  virtual Int_t  IsVersion() const {return 1;}
  /** Member function that is executed each time a hit is made in the 
      FMD.  None-charged particles are ignored.   Dead tracks  are
      ignored.  
      
      The procedure is as follows: 
      - IF NOT track is alive THEN RETURN ENDIF
      - IF NOT particle is charged THEN RETURN ENDIF
      - IF NOT volume name is "STRI" or "STRO" THEN RETURN ENDIF 
      - Get strip number (volume copy # minus 1)
      - Get phi division number (mother volume copy #)
      - Get module number (grand-mother volume copy #)
      - section # = 2 * module # + phi division # - 1
      - Get ring Id from volume name 
      - Get detector # from grand-grand-grand-mother volume name 
      - Get pointer to sub-detector object. 
      - Get track position 
      - IF track is entering volume AND track is inside real shape THEN
      -   Reset energy deposited 
      -   Get track momentum 
      -   Get particle ID # 
      - ENDIF
      - IF track is inside volume AND inside real shape THEN 
      -   Update energy deposited 
      - ENDIF 
      - IF track is inside real shape AND (track is leaving volume,
           or it died, or it is stopped  THEN
      -   Create a hit 
      - ENDIF 
  */
  virtual void   StepManager();
protected:
  /** Translate VMC coordinates to detector coordinates
      @param v        On output, Current position
      @param detector On output, detector #
      @param ring     On output, ring id
      @param sector   On output, sector #
      @param strip    On output, strip #
      @return @c true on success */
  Bool_t VMC2FMD(TLorentzVector& v, UShort_t& detector,
		 Char_t& ring, UShort_t& sector, UShort_t& strip) const;
  /** Translate VMC coordinates to detector coordinates
      @param copy     Volume copy number 
      @param v        On output, Current position
      @param detector On output, detector #
      @param ring     On output, ring id
      @param sector   On output, sector #
      @param strip    On output, strip #
      @return @c true on success */
  Bool_t VMC2FMD(Int_t copy, TLorentzVector& v,
		 UShort_t& detector, Char_t& ring,
		 UShort_t& sector, UShort_t& strip) const;
  /** Check if hit is bad.  A hit is bad if 
      @f[
      \Delta E > |Q|^2 p / m > 1 
      @f]
      holds, where @f$ \Delta E@f$ is the energy loss in this step, 
      @f$ Q@f$ is the particle charge, @f$ p@f$ is the track momentum,
      and @f$ m@f$ is the particle mass.   If a track is marked as
      bad, it's kept in a cache, and can be printed at the end of the
      event. 
      @param trackno Track number 
      @param pdg     PDG particle type ID
      @param absQ    Absolute value of particle charge
      @param p       Track momentum
      @param edep    Energy loss in this step.
      @return @c true if hit is `bad' */
  Bool_t CheckHit(Int_t trackno, Int_t pdg, Float_t absQ, 
		  const TLorentzVector& p, Float_t edep) const;

  Double_t       fCurrentDeltaE;    // The current accumulated energy loss
  TLorentzVector fCurrentV;         // Current production vertex 
  TLorentzVector fCurrentP;         // Current momentum vector 
  Int_t          fCurrentPdg;       // Current PDG code 
  
  ClassDef(AliFMDv1,5)  // Detailed FMD geometry
};

#endif
//____________________________________________________________________
//
// Local Variables:
//   mode: C++
// End:
//
// EOF
//
 AliFMDv1.h:1
 AliFMDv1.h:2
 AliFMDv1.h:3
 AliFMDv1.h:4
 AliFMDv1.h:5
 AliFMDv1.h:6
 AliFMDv1.h:7
 AliFMDv1.h:8
 AliFMDv1.h:9
 AliFMDv1.h:10
 AliFMDv1.h:11
 AliFMDv1.h:12
 AliFMDv1.h:13
 AliFMDv1.h:14
 AliFMDv1.h:15
 AliFMDv1.h:16
 AliFMDv1.h:17
 AliFMDv1.h:18
 AliFMDv1.h:19
 AliFMDv1.h:20
 AliFMDv1.h:21
 AliFMDv1.h:22
 AliFMDv1.h:23
 AliFMDv1.h:24
 AliFMDv1.h:25
 AliFMDv1.h:26
 AliFMDv1.h:27
 AliFMDv1.h:28
 AliFMDv1.h:29
 AliFMDv1.h:30
 AliFMDv1.h:31
 AliFMDv1.h:32
 AliFMDv1.h:33
 AliFMDv1.h:34
 AliFMDv1.h:35
 AliFMDv1.h:36
 AliFMDv1.h:37
 AliFMDv1.h:38
 AliFMDv1.h:39
 AliFMDv1.h:40
 AliFMDv1.h:41
 AliFMDv1.h:42
 AliFMDv1.h:43
 AliFMDv1.h:44
 AliFMDv1.h:45
 AliFMDv1.h:46
 AliFMDv1.h:47
 AliFMDv1.h:48
 AliFMDv1.h:49
 AliFMDv1.h:50
 AliFMDv1.h:51
 AliFMDv1.h:52
 AliFMDv1.h:53
 AliFMDv1.h:54
 AliFMDv1.h:55
 AliFMDv1.h:56
 AliFMDv1.h:57
 AliFMDv1.h:58
 AliFMDv1.h:59
 AliFMDv1.h:60
 AliFMDv1.h:61
 AliFMDv1.h:62
 AliFMDv1.h:63
 AliFMDv1.h:64
 AliFMDv1.h:65
 AliFMDv1.h:66
 AliFMDv1.h:67
 AliFMDv1.h:68
 AliFMDv1.h:69
 AliFMDv1.h:70
 AliFMDv1.h:71
 AliFMDv1.h:72
 AliFMDv1.h:73
 AliFMDv1.h:74
 AliFMDv1.h:75
 AliFMDv1.h:76
 AliFMDv1.h:77
 AliFMDv1.h:78
 AliFMDv1.h:79
 AliFMDv1.h:80
 AliFMDv1.h:81
 AliFMDv1.h:82
 AliFMDv1.h:83
 AliFMDv1.h:84
 AliFMDv1.h:85
 AliFMDv1.h:86
 AliFMDv1.h:87
 AliFMDv1.h:88
 AliFMDv1.h:89
 AliFMDv1.h:90
 AliFMDv1.h:91
 AliFMDv1.h:92
 AliFMDv1.h:93
 AliFMDv1.h:94
 AliFMDv1.h:95
 AliFMDv1.h:96
 AliFMDv1.h:97
 AliFMDv1.h:98
 AliFMDv1.h:99
 AliFMDv1.h:100
 AliFMDv1.h:101
 AliFMDv1.h:102
 AliFMDv1.h:103
 AliFMDv1.h:104
 AliFMDv1.h:105
 AliFMDv1.h:106
 AliFMDv1.h:107
 AliFMDv1.h:108
 AliFMDv1.h:109
 AliFMDv1.h:110
 AliFMDv1.h:111
 AliFMDv1.h:112
 AliFMDv1.h:113
 AliFMDv1.h:114
 AliFMDv1.h:115
 AliFMDv1.h:116
 AliFMDv1.h:117
 AliFMDv1.h:118
 AliFMDv1.h:119
 AliFMDv1.h:120
 AliFMDv1.h:121
 AliFMDv1.h:122
 AliFMDv1.h:123
 AliFMDv1.h:124
 AliFMDv1.h:125
 AliFMDv1.h:126
 AliFMDv1.h:127
 AliFMDv1.h:128
 AliFMDv1.h:129
 AliFMDv1.h:130
 AliFMDv1.h:131
 AliFMDv1.h:132
 AliFMDv1.h:133
 AliFMDv1.h:134
 AliFMDv1.h:135
 AliFMDv1.h:136
 AliFMDv1.h:137
 AliFMDv1.h:138
 AliFMDv1.h:139
 AliFMDv1.h:140
 AliFMDv1.h:141
 AliFMDv1.h:142
 AliFMDv1.h:143
 AliFMDv1.h:144
 AliFMDv1.h:145
 AliFMDv1.h:146
 AliFMDv1.h:147
 AliFMDv1.h:148
 AliFMDv1.h:149
 AliFMDv1.h:150
 AliFMDv1.h:151