ROOT logo
#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 
 

#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();
    
    
                   /// 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 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, 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);
   
    // 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);
    
                    /// Set flag to inactivate calls to TVirtualMC::GetMC()->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(Int_t trigResV1 = 0)
	{ fTriggerResponseV1 = trigResV1; }
    virtual Int_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;}

	// Getters
                  /// Return reference to Chamber \a id
    virtual AliMUONChamber& Chamber(Int_t id)
      {return *((AliMUONChamber *) (*fChambers)[id]);}

    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 
   
    //
    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 TVirtualMC::GetMC()->SetMaxStep
    Bool_t fTriggerScalerEvent; ///< Flag to generates scaler event
    Int_t  fTriggerResponseV1;  ///< Flag to select TriggerResponseV1 (for cluster size in MTR)
    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

    AliMUONVHitStore* fHitStore; //!< container of hits
    
    TString fDigitStoreConcreteClassName; ///< to be able to select what the sdigitizer uses
    
    AliMUONCalibrationData* fCalibrationData; ///< pointer of calibration data

  AliMUONDigitCalibrator* fDigitCalibrator; //!< digit calibrator (for raw2sdigits)
  
    ClassDef(AliMUON,25)  // MUON Detector base class
};
#endif

 AliMUON.h:1
 AliMUON.h:2
 AliMUON.h:3
 AliMUON.h:4
 AliMUON.h:5
 AliMUON.h:6
 AliMUON.h:7
 AliMUON.h:8
 AliMUON.h:9
 AliMUON.h:10
 AliMUON.h:11
 AliMUON.h:12
 AliMUON.h:13
 AliMUON.h:14
 AliMUON.h:15
 AliMUON.h:16
 AliMUON.h:17
 AliMUON.h:18
 AliMUON.h:19
 AliMUON.h:20
 AliMUON.h:21
 AliMUON.h:22
 AliMUON.h:23
 AliMUON.h:24
 AliMUON.h:25
 AliMUON.h:26
 AliMUON.h:27
 AliMUON.h:28
 AliMUON.h:29
 AliMUON.h:30
 AliMUON.h:31
 AliMUON.h:32
 AliMUON.h:33
 AliMUON.h:34
 AliMUON.h:35
 AliMUON.h:36
 AliMUON.h:37
 AliMUON.h:38
 AliMUON.h:39
 AliMUON.h:40
 AliMUON.h:41
 AliMUON.h:42
 AliMUON.h:43
 AliMUON.h:44
 AliMUON.h:45
 AliMUON.h:46
 AliMUON.h:47
 AliMUON.h:48
 AliMUON.h:49
 AliMUON.h:50
 AliMUON.h:51
 AliMUON.h:52
 AliMUON.h:53
 AliMUON.h:54
 AliMUON.h:55
 AliMUON.h:56
 AliMUON.h:57
 AliMUON.h:58
 AliMUON.h:59
 AliMUON.h:60
 AliMUON.h:61
 AliMUON.h:62
 AliMUON.h:63
 AliMUON.h:64
 AliMUON.h:65
 AliMUON.h:66
 AliMUON.h:67
 AliMUON.h:68
 AliMUON.h:69
 AliMUON.h:70
 AliMUON.h:71
 AliMUON.h:72
 AliMUON.h:73
 AliMUON.h:74
 AliMUON.h:75
 AliMUON.h:76
 AliMUON.h:77
 AliMUON.h:78
 AliMUON.h:79
 AliMUON.h:80
 AliMUON.h:81
 AliMUON.h:82
 AliMUON.h:83
 AliMUON.h:84
 AliMUON.h:85
 AliMUON.h:86
 AliMUON.h:87
 AliMUON.h:88
 AliMUON.h:89
 AliMUON.h:90
 AliMUON.h:91
 AliMUON.h:92
 AliMUON.h:93
 AliMUON.h:94
 AliMUON.h:95
 AliMUON.h:96
 AliMUON.h:97
 AliMUON.h:98
 AliMUON.h:99
 AliMUON.h:100
 AliMUON.h:101
 AliMUON.h:102
 AliMUON.h:103
 AliMUON.h:104
 AliMUON.h:105
 AliMUON.h:106
 AliMUON.h:107
 AliMUON.h:108
 AliMUON.h:109
 AliMUON.h:110
 AliMUON.h:111
 AliMUON.h:112
 AliMUON.h:113
 AliMUON.h:114
 AliMUON.h:115
 AliMUON.h:116
 AliMUON.h:117
 AliMUON.h:118
 AliMUON.h:119
 AliMUON.h:120
 AliMUON.h:121
 AliMUON.h:122
 AliMUON.h:123
 AliMUON.h:124
 AliMUON.h:125
 AliMUON.h:126
 AliMUON.h:127
 AliMUON.h:128
 AliMUON.h:129
 AliMUON.h:130
 AliMUON.h:131
 AliMUON.h:132
 AliMUON.h:133
 AliMUON.h:134
 AliMUON.h:135
 AliMUON.h:136
 AliMUON.h:137
 AliMUON.h:138
 AliMUON.h:139
 AliMUON.h:140
 AliMUON.h:141
 AliMUON.h:142
 AliMUON.h:143
 AliMUON.h:144
 AliMUON.h:145
 AliMUON.h:146
 AliMUON.h:147
 AliMUON.h:148
 AliMUON.h:149
 AliMUON.h:150
 AliMUON.h:151
 AliMUON.h:152
 AliMUON.h:153
 AliMUON.h:154
 AliMUON.h:155
 AliMUON.h:156
 AliMUON.h:157
 AliMUON.h:158
 AliMUON.h:159
 AliMUON.h:160
 AliMUON.h:161
 AliMUON.h:162
 AliMUON.h:163
 AliMUON.h:164
 AliMUON.h:165
 AliMUON.h:166
 AliMUON.h:167
 AliMUON.h:168
 AliMUON.h:169
 AliMUON.h:170
 AliMUON.h:171
 AliMUON.h:172
 AliMUON.h:173
 AliMUON.h:174
 AliMUON.h:175
 AliMUON.h:176
 AliMUON.h:177
 AliMUON.h:178
 AliMUON.h:179
 AliMUON.h:180
 AliMUON.h:181
 AliMUON.h:182
 AliMUON.h:183
 AliMUON.h:184
 AliMUON.h:185
 AliMUON.h:186
 AliMUON.h:187
 AliMUON.h:188
 AliMUON.h:189
 AliMUON.h:190
 AliMUON.h:191
 AliMUON.h:192
 AliMUON.h:193
 AliMUON.h:194
 AliMUON.h:195
 AliMUON.h:196
 AliMUON.h:197
 AliMUON.h:198
 AliMUON.h:199
 AliMUON.h:200
 AliMUON.h:201
 AliMUON.h:202
 AliMUON.h:203