]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamber.cxx
No more misaligned_geometry
[u/mrichter/AliRoot.git] / MUON / AliMUONChamber.cxx
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 /* $Id$ */
17
18 // -----------------------
19 // Class AliMUONChamber
20 // -----------------------
21 // MUON tracking chamber class
22 // now only providing DisIntegration function
23
24 // --- ROOT includes ---
25 #include <TRandom.h>
26 #include <TMath.h>
27 #include "AliRun.h"
28
29
30 // --- MUON includes ---
31 #include "AliMUON.h"
32 #include "AliMUONChamber.h"
33 #include "AliMUONHit.h"
34 #include "AliLog.h"
35
36 /// \cond CLASSIMP
37 ClassImp(AliMUONChamber)        
38 /// \endcond
39
40 //_______________________________________________________
41 AliMUONChamber::AliMUONChamber()
42   : TObject(), 
43     fId(0),
44     fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
45     fResponse(0),
46     fMUON(0)
47 {
48 /// Default constructor
49
50   AliDebug(1, Form("default (empty) ctor this = %p", this));
51 }
52
53 //_______________________________________________________
54 AliMUONChamber::AliMUONChamber(Int_t id) 
55   : TObject(), 
56     fId(id),
57     fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
58     fResponse(0),
59     fMUON(0)
60 {
61 /// Standard constructor
62
63     // muon
64     fMUON = (AliMUON*)gAlice->GetModule("MUON");
65     if (!fMUON) {
66       AliFatal("MUON detector not defined.");
67       return;
68     }  
69
70   AliDebug(1, Form("ctor this = %p", this) ); 
71 }
72
73 //_______________________________________________________
74 AliMUONChamber::~AliMUONChamber() 
75 {
76 /// Destructor
77
78   AliDebug(1, Form("dtor this = %p", this));
79   delete fResponse;
80 }
81
82 //_____________________________________________________
83 void AliMUONChamber::ChargeCorrelationInit() 
84 {
85 /// Initialisation of charge correlation for current hit
86 /// the value is stored, and then used by Disintegration
87
88   // exponential is here to avoid eventual problems in 0 
89   // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
90     fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
91 }
92
93 //_____________________________________________________________________________
94 void
95 AliMUONChamber::SetResponseModel(const AliMUONResponse& thisResponse)
96 {
97   delete fResponse;
98   fResponse = static_cast<AliMUONResponse*>(thisResponse.Clone());
99 }
100