]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUON.h
- Trigger chamber efficiency will be used by default when creating AliMUON
[u/mrichter/AliRoot.git] / MUON / AliMUON.h
index 26d99a8be198ae66ac497dfd1175831d651fb6bd..a78db630100f89e1d90bfb82f7973328245c4515 100644 (file)
-#ifndef MUON_H
-#define MUON_H
-////////////////////////////////////////////////
-//  Manager and hits classes for set:MUON     //
-////////////////////////////////////////////////
-#include "AliDetector.h"
-#include "AliHit.h"
-#include "AliMUONConst.h"
-#include "AliDigit.h"
-#include "AliMUONchamber.h"
-#include "AliMUONSegRes.h"
-#include <TVector.h>
-#include <TObjArray.h>
-#include <TArrayF.h>
-#include <TFile.h>
-#include <TTree.h>
-typedef enum {simple, medium, big} Cluster_t;
-
-static const int NCH=14;
-
-class AliMUONcluster;
-class AliMUONRawCluster;
-class AliMUONClusterFinder;
-class AliMUONcorrelation;
-
-
-//----------------------------------------------
-
-class AliMUONcluster : public TObject {
-public:
-
-   Int_t     fHitNumber;    // Hit number
-   Int_t     fCathode;      // Cathode number
-   Int_t     fQ  ;          // Total charge      
-   Int_t     fPadX  ;       // Pad number along X
-   Int_t     fPadY  ;       // Pad number along Y
-   Int_t     fQpad  ;       // Charge per pad
-   Int_t     fRSec  ;       // R -sector of pad
-public:
-   AliMUONcluster() {
-      fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0;   
-}
-   AliMUONcluster(Int_t *clhits);
-   virtual ~AliMUONcluster() {;}
-   ClassDef(AliMUONcluster,1)  //Cluster object for set:MUON
-};
-
-class AliMUONreccluster : public TObject {
-public:
-
-   Int_t     fTracks[3];      //labels of overlapped tracks
-
-   Int_t       fQ  ;          // Q of cluster (in ADC counts)     
-   Float_t     fX  ;          // X of cluster
-   Float_t     fY  ;          // Y of cluster
-
-public:
-   AliMUONreccluster() {
-       fTracks[0]=fTracks[1]=fTracks[2]=-1; 
-       fQ=0; fX=fY=0; 
-   }
-   virtual ~AliMUONreccluster() {;}
+#ifndef ALIMUON_H
+#define ALIMUON_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+// Revision of includes 12/01/2009
+
+/// \ingroup sim
+/// \class AliMUON
+/// \brief AliDetector class for MUON subsystem providing
+/// simulation data management 
  
-   ClassDef(AliMUONreccluster,1)  //Cluster object for set:MUON
-};
-
-//_____________________________________________________________________________
-
-class AliMUONdigit : public TObject {
- public:
-    Int_t     fPadX;        // Pad number along x
-    Int_t     fPadY ;       // Pad number along y
-    Int_t     fSignal;      // Signal amplitude
-    Int_t     fTcharges[10];   // charge per track making this digit (up to 10)
-    Int_t     fTracks[10];     // primary tracks making this digit (up to 10)
-    Int_t     fPhysics;        // physics contribution to signal 
-    Int_t     fHit;            // hit number - temporary solution
-
 
- public:
-    AliMUONdigit() {}
-    AliMUONdigit(Int_t *digits);
-    AliMUONdigit(Int_t *tracks, Int_t *charges, Int_t *digits);
-    virtual ~AliMUONdigit();
+#include "AliDetector.h"
+#include "AliMUONChamber.h"
+#include "AliMUONTrigger.h"
+
+#include <TString.h>
+
+class AliMUONResponse;
+class AliMUONGeometry;
+class AliMUONGeometryTransformer;
+class AliMUONGeometryBuilder;
+class AliMUONRawWriter;
+class AliMUONVGeometryBuilder;
+class AliMUONDigitMaker;
+class AliMUONVHitStore;
+class AliMUONCalibrationData;
+class AliMUONDigitCalibrator;
+class AliMUONRecoParam;
+
+class AliLoader;
+
+class TObjArray;
+
+class AliMUON : public  AliDetector 
+{
+  public:
+    AliMUON();
+    AliMUON(const char* name, const char* title);
+    virtual ~AliMUON();
+   
+    // Geometry
+    void AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder);
+    void ResetGeometryBuilder();
     
-    ClassDef(AliMUONdigit,1)  //Digits for set:MUON
-};
-//_____________________________________________________________________________
-
-class AliMUONlist : public AliMUONdigit {
- public:
-    Int_t          fChamber;       // chamber number of pad
-    TObjArray     *fTrackList; 
- public:
-    AliMUONlist() {fTrackList=0;}
-    AliMUONlist(Int_t rpad, Int_t *digits);
-    virtual ~AliMUONlist() {delete fTrackList;}
-    TObjArray  *TrackList()   {return fTrackList;}
-    ClassDef(AliMUONlist,1)  //Digits for set:MUON
-};
-//___________________________________________
-
-
-//___________________________________________
-class AliMUONhit : public AliHit {
- public:
-    Int_t     fChamber;       // Chamber number
-    Float_t   fParticle;      // Geant3 particle type
-    Float_t   fTheta ;        // Incident theta angle in degrees      
-    Float_t   fPhi   ;        // Incident phi angle in degrees
-    Float_t   fTlength;       // Track length inside the chamber
-    Float_t   fEloss;         // ionisation energy loss in gas   
-    Int_t     fPHfirst;       // first padhit
-    Int_t     fPHlast;        // last padhit
-
-// modifs perso
-    Float_t   fPTot;          // hit momentum P
-    Float_t   fCxHit;            // Px/P
-    Float_t   fCyHit;            // Py/P
-    Float_t   fCzHit;            // Pz/P
-
- public:
-    AliMUONhit() {}
-    AliMUONhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
-    virtual ~AliMUONhit() {}
     
-    ClassDef(AliMUONhit,1)  //Hits object for set:MUON
-};
-
-class AliMUON : public  AliDetector {
- public:
-    AliMUON();
-    AliMUON(const char *name, const char *title);
-    virtual       ~AliMUON();
-    virtual void   AddHit(Int_t, Int_t*, Float_t*);
-    virtual void   AddCluster(Int_t*);
-    virtual void   AddDigits(Int_t, Int_t*, Int_t*, Int_t*);
-    virtual void   AddRawCluster(Int_t, const AliMUONRawCluster&);
-    virtual void   AddCathCorrel(Int_t, Int_t*, Float_t*, Float_t*);
-    virtual void   BuildGeometry();
-    virtual void   CreateGeometry() {}
-    virtual void   CreateMaterials() {}
-    virtual void   StepManager();
-    Int_t          DistancetoPrimitive(Int_t px, Int_t py);
-    virtual Int_t  IsVersion() const =0;
-//
-    TClonesArray  *Clusters() {return fClusters;}
-    virtual  void  MakeTreeC(Option_t *option="C");
-    void           GetTreeC(Int_t);
-    virtual void   MakeBranch(Option_t *opt=" ");
-    void           SetTreeAddress();
-    virtual void   ResetHits();
-    virtual void   ResetDigits();
-    virtual void   ResetRawClusters();
-    virtual void   ResetCorrelation();
-    virtual void   FindClusters(Int_t,Int_t);
-    virtual void   Digitise(Int_t,Int_t,Option_t *opt1=" ",Option_t *opt2=" ",Text_t *name=" ");
-    virtual void   CathodeCorrelation(Int_t);
-    virtual void   SortTracks(Int_t *,Int_t *,Int_t);
-//
-// modifs perso
-
-    void     InitTracking(Double_t &, Double_t &, Double_t &);
-    void     Reconst(Int_t &,Int_t &,Int_t,Int_t &,Int_t&,Int_t&, Option_t *option,Text_t *filename);
-    void     FinishEvent();
-    void     CloseTracking();
-    void     SetCutPxz(Double_t p) {fSPxzCut=p;}
-    void     SetSigmaCut(Double_t p) {fSSigmaCut=p;}
-    void     SetXPrec(Double_t p) {fSXPrec=p;}
-    void     SetYPrec(Double_t p) {fSYPrec=p;}
-    Double_t GetCutPxz() {return fSPxzCut;}
-    Double_t GetSigmaCut() {return fSSigmaCut;}
-    Double_t GetXPrec() {return fSXPrec;}
-    Double_t GetYPrec() {return fSYPrec;}
-// fin modifs perso 
+                   /// Return geometry builder
+    AliMUONGeometryBuilder*            GetGeometryBuilder() const {return fGeometryBuilder;}
+    const AliMUONGeometryTransformer*  GetGeometryTransformer() const;
+                   /// Return segmentation
+
+    // MUONLoader definition
+    virtual AliLoader* MakeLoader(const char* topfoldername); //builds standard getter (AliLoader type)
+
+    virtual void   SetTreeAddress();
+                  
+                   /// Set split level for making branches in outfiles
+    virtual void   SetSplitLevel(Int_t SplitLevel)     {fSplitLevel=SplitLevel;}
+
+    // Digitisation 
+    virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const;
+    virtual void   SDigits2Digits();      
+    virtual void   Hits2SDigits();
+    virtual void   Digits2Raw();
+    virtual Bool_t Raw2SDigits(AliRawReader* rawReader);
+
+    // Trigger
+                   /// Create trigger
+    virtual AliTriggerDetector* CreateTriggerDetector() const
+       { return new AliMUONTrigger(); }
     
-// Configuration Methods (per station id)
-//
-// Set Chamber Segmentation Parameters
-// id refers to the station and isec to the cathode plane   
-    virtual void   SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2);
 
-// Set Signal Generation Parameters
+    // Configuration Methods (per station id)
+    //
+    // Set Signal Generation Parameters
     virtual void   SetSigmaIntegration(Int_t id, Float_t p1);
     virtual void   SetChargeSlope(Int_t id, Float_t p1);
     virtual void   SetChargeSpread(Int_t id, Float_t p1, Float_t p2);
-    virtual void   SetMaxAdc(Int_t id, Float_t p1);
-// Set Segmentation and Response Model
-    virtual void   SetSegmentationModel(Int_t id, Int_t isec, AliMUONsegmentation *segmentation);
-    virtual void   SetResponseModel(Int_t id, AliMUONresponse *response);
-    virtual void   SetNsec(Int_t id, Int_t nsec);
-// Set Reconstruction Model
-    virtual void   SetReconstructionModel(Int_t id, AliMUONClusterFinder *reconstruction);
-// Set Stepping Parameters
+    virtual void   SetMaxAdc(Int_t id, Int_t p1);
+    // Set Response Model
+    virtual void   SetResponseModel(Int_t id, const AliMUONResponse& response);
+
+    // Set Stepping Parameters
     virtual void   SetMaxStepGas(Float_t p1);
     virtual void   SetMaxStepAlu(Float_t p1);
     virtual void   SetMaxDestepGas(Float_t p1);
     virtual void   SetMaxDestepAlu(Float_t p1);
-    virtual void   SetMuonAcc(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9);
-// Response Simulation
-    virtual void   MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id);
-// Return reference to Chamber #id
-    virtual AliMUONchamber& Chamber(Int_t id) {return *((AliMUONchamber *) (*fChambers)[id]);}
-// Retrieve pad hits for a given Hit
-    virtual AliMUONcluster* FirstPad(AliMUONhit *, TClonesArray *);
-    virtual AliMUONcluster* NextPad(TClonesArray *);
-// Return pointers to digits 
-    TObjArray            *Dchambers() {return fDchambers;}
-    Int_t                *Ndch() {return fNdch;}
-    virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
-// Return pointers to reconstructed clusters
-    TObjArray            *RawClusters() {return fRawClusters;}
-    Int_t                *Nrawch() {return fNrawch;}
-    virtual TClonesArray *RawClustAddress(Int_t id) {return ((TClonesArray *) (*fRawClusters)[id]);}
-
-// modifs perso
-    AliMUONRawCluster *RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster);
+   
+    // Get Stepping Parameters
+    virtual Float_t  GetMaxStepGas() const;
+    virtual Float_t  GetMaxStepAlu() const;
+    virtual Float_t  GetMaxDestepGas() const;
+    virtual Float_t  GetMaxDestepAlu() const;
     
+    // Set alignement option
+    virtual void  SetAlign(Bool_t align = true);
+    virtual void  SetAlign(const TString& fileName, Bool_t align = true);
     
-    // Return pointers to list of correlated clusters
-    TObjArray            *CathCorrel() {return fCathCorrel;}
-    Int_t                *Ncorch() {return fNcorch;}
-    virtual TClonesArray *CathCorrelAddress(Int_t id)
-       {return ((TClonesArray *) (*fCathCorrel)[id]);}
-
-// Return pointer to TreeC
-    TTree      *TreeC() {return fTreeC;} 
- protected:
-    TObjArray            *fChambers;           // List of Tracking Chambers
-    Int_t                fNclusters;           // Number of clusters
-    TClonesArray         *fClusters;           // List of clusters
-    TObjArray            *fDchambers;          // List of digits
-    Int_t                *fNdch;               // Number of digits
-
-
-    TObjArray            *fRawClusters;            // List of raw clusters
-    Int_t                *fNrawch;                 // Number of raw clusters
-    TObjArray            *fCathCorrel;             // List of correlated clusters
-    Int_t                *fNcorch;                 // Number of correl clusters
-    TTree                *fTreeC;                  // Cathode correl index tree
-
-//
-    Bool_t   fAccCut;          //Transport acceptance cut
-    Float_t  fAccMin;          //Minimum acceptance cut used during transport
-    Float_t  fAccMax;          //Minimum acceptance cut used during transport
-//  
+                    /// Set flag to inactivate calls to gMC->SetMaxStep
+    virtual void  SetIsMaxStep(Bool_t isMaxStep) { fIsMaxStep = isMaxStep; }
+    
+                   /// Set scaler event for trigger
+    virtual void  SetTriggerScalerEvent(Bool_t scaler = true){fTriggerScalerEvent = scaler;}
+
+                  /// Set trigger response version
+    virtual void  SetTriggerResponseV1(Bool_t trigResV1 = false)
+       { fTriggerResponseV1 = trigResV1; }
+    virtual Bool_t GetTriggerResponseV1() const;
+                  /// Set trigger coinc44
+    virtual void  SetTriggerCoinc44(Int_t trigCoinc44 = 0)
+       { fTriggerCoinc44 = trigCoinc44; }
+    virtual Int_t GetTriggerCoinc44() const;
+                 /// Set trigger chamber efficiency by cells
+    virtual void SetTriggerEffCells(Bool_t trigEffCells = true)
+       { fTriggerEffCells = trigEffCells; }
+    virtual Bool_t GetTriggerEffCells() const;
+                 /// Set off generation of noisy digits
+  virtual void SetDigitizerWithNoise(Int_t digitizerWithNoise, Double_t nsigmas=4.0)
+  { fDigitizerWithNoise = digitizerWithNoise; fDigitizerNSigmas = nsigmas; }
+  
+    virtual Int_t GetDigitizerWithNoise() const; 
+  
+  virtual Double_t GetDigitizerNSigmas() const { return fDigitizerNSigmas; }
+
+  /// Parametrised tail effect in resolution histogram
+  virtual void SetTailEffect(Bool_t isTailEffect) { fIsTailEffect=isTailEffect; }
+    
+       /// Enable trigger raw2sdigits conversion 
+       virtual void SetConvertTrigger(Bool_t convertTrigger = true) { fConvertTrigger = convertTrigger;}
 
-//  Stepping Parameters
-   Float_t fMaxStepGas;      // Maximum step size inside the chamber gas
-   Float_t fMaxStepAlu;      // Maximum step size inside the chamber aluminum
-   Float_t fMaxDestepGas;    // Maximum relative energy loss in gas
-   Float_t fMaxDestepAlu;    // Maximum relative energy loss in aluminum
-//
-// modifs perso
-//  Parameters for reconstruction program
-   Double_t fSPxzCut;        // Pxz cut  (GeV/c) to begin the track finding
-   Double_t fSSigmaCut;      // Number of sig. delimiting the searching areas
-   Double_t fSXPrec;         // Chamber precision in X (cm) 
-   Double_t fSYPrec;         // Chamber precision in Y (cm)
+       // Getters
+                  /// Return reference to Chamber \a id
+    virtual AliMUONChamber& Chamber(Int_t id)
+      {return *((AliMUONChamber *) (*fChambers)[id]);}
 
-   Text_t *fFileName;
+    virtual void MakeBranch(Option_t* opt=" ");
+    virtual void ResetHits();
+    
+                 /// Set digit store class name           
+    void SetDigitStoreClassName(const char* classname) { fDigitStoreConcreteClassName = classname; }
+                 /// Return digit store class name           
+    const TString DigitStoreClassName() const { return fDigitStoreConcreteClassName; }
+    
+  protected:
+    /// Not implemented
+    AliMUON(const AliMUON& rMUON);
+    /// Not implemented
+    AliMUON& operator = (const AliMUON& rhs);
+
+    const AliMUONGeometry* GetGeometry() const;
+
+  AliMUONRecoParam* GetRecoParam() const;
+  
+    Int_t                 fNCh;                ///< Number of chambers   
+    Int_t                 fNTrackingCh;        ///< Number of tracking chambers*
+    Int_t                 fSplitLevel;         ///< Splitlevel when making branches in outfiles.
+    TObjArray*            fChambers;           ///< List of Tracking Chambers
+    AliMUONGeometryBuilder*  fGeometryBuilder; ///< Geometry builder 
    
- protected:
-
-   ClassDef(AliMUON,1)  //Hits manager for set:MUON
-};
-//___________________________________________
-
-class AliMUONRawCluster : public TObject {
-public:
-
-   Int_t     fTracks[3];      //labels of overlapped tracks
-   Int_t       fQ  ;          // Q of cluster (in ADC counts)     
-   Float_t     fX  ;          // X of cluster
-   Float_t     fY  ;          // Y of cluster
-   Int_t       fPeakSignal;
-   Int_t       fIndexMap[50];  //indeces of digits
-   Int_t       fOffsetMap[50]; //Emmanuel special
-   Float_t     fContMap[50];   //Contribution from digit
-   Int_t       fPhysicsMap[50];
-   Int_t       fMultiplicity;  //cluster multiplicity
-   Int_t       fNcluster[2];
-   Int_t       fClusterType;   
- public:
-   AliMUONRawCluster() {
-       fTracks[0]=fTracks[1]=fTracks[2]=-1; 
-       fQ=0; fX=fY=0; fMultiplicity=0;
-       for (int k=0;k<50;k++) {
-           fIndexMap[k]=-1;
-           fOffsetMap[k]=0;
-          fContMap[k]=0;
-          fPhysicsMap[k]=-1;
-       }
-       fNcluster[0]=fNcluster[1]=-1;
-   }
-   virtual ~AliMUONRawCluster() {}
-
-   Float_t GetRadius() {return TMath::Sqrt(fX*fX+fY*fY);}
-
-   Bool_t IsSortable() const {return kTRUE;}
-   Int_t  Compare(TObject *obj);
-   Int_t PhysicsContribution();
-   static Int_t BinarySearch(Float_t r, TArrayF, Int_t from, Int_t upto);
-   static void  SortMin(Int_t *,Float_t *,Float_t *,Float_t *,Float_t *,Int_t);
-   ClassDef(AliMUONRawCluster,1)  //Cluster object for set:MUON
-};
-
-//___________________________________________
-class AliMUONcorrelation : public TObject {
-public:
-
-  // correlation starts from the 1-st cathode  
-  // last number in arrays corresponds to cluster on 1-st cathode
+    //
+    Bool_t   fAccCut;         ///< Transport acceptance cut
+    Float_t  fAccMin;         ///< Minimum acceptance cut used during transport
+    Float_t  fAccMax;         ///< Minimum acceptance cut used during transport
+    //  
+    //  Stepping Parameters
+    Float_t fMaxStepGas;      ///< Maximum step size inside the chamber gas
+    Float_t fMaxStepAlu;      ///< Maximum step size inside the chamber aluminum
+    Float_t fMaxDestepGas;    ///< Maximum relative energy loss in gas
+    Float_t fMaxDestepAlu;    ///< Maximum relative energy loss in aluminum
+    
+    // Pad Iterator
+    Int_t fMaxIterPad;        ///< Maximum pad index
+    Int_t fCurIterPad;        ///< Current pad index
+   
+    // Options
+    Bool_t fIsMaxStep;          ///< Flag to inactivate calls to gMC->SetMaxStep
+    Bool_t fTriggerScalerEvent; ///< Flag to generates scaler event
+    Bool_t fTriggerResponseV1;  ///< Flag to select TriggerResponseV1
+    Int_t  fTriggerCoinc44;     ///< Flag to select TriggerCoinc44 
+    Bool_t fTriggerEffCells;    ///< Flag to select TriggerEffCells
+    Int_t  fDigitizerWithNoise; ///< Flag to switch on/off generation of noisy digits
+    Double_t fDigitizerNSigmas; ///< nsigma cut for noise generation
+    Bool_t fIsTailEffect;       ///< Switch to turn on/off the tail effect
+       Bool_t fConvertTrigger;     ///< Switch to enable trigger raw2sdigit conversion 
+
+    AliMUONRawWriter* fRawWriter; //!< Raw data writer
+    
+    AliMUONDigitMaker* fDigitMaker; //!< pointer to the digit maker class
 
-   Int_t       fCorrelIndex[4];  // entry number in TreeR for the associated 
-                                 // cluster candidates on the 2-nd cathode
-   Float_t     fX[4]  ;          // X of clusters on the 2-nd cathode  
-   Float_t     fY[4]  ;          // Y of clusters
+    AliMUONVHitStore* fHitStore; //!< container of hits
+    
+    TString fDigitStoreConcreteClassName; ///< to be able to select what the sdigitizer uses
+    
+    AliMUONCalibrationData* fCalibrationData; ///< pointer of calibration data
 
-public:
-   AliMUONcorrelation() {
-       fCorrelIndex[0]=fCorrelIndex[1]=fCorrelIndex[2]=fCorrelIndex[3]=0;
-       fX[0]=fX[1]=fX[2]=fX[3]=0; fY[0]=fY[1]=fY[2]=fY[3]=0; 
-   }
-   AliMUONcorrelation(Int_t *idx, Float_t *x, Float_t *y);
-   virtual ~AliMUONcorrelation() {}
-   ClassDef(AliMUONcorrelation,1)  //Cathode correlation object for set:MUON
+  AliMUONDigitCalibrator* fDigitCalibrator; //!< digit calibrator (for raw2sdigits)
+  
+    ClassDef(AliMUON,25)  // MUON Detector base class
 };
-
 #endif
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-