AliRoot Core  edcc906 (edcc906)
AliMUONChamber.cxx
Go to the documentation of this file.
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 
25 // --- ROOT includes ---
26 #include <TRandom.h>
27 #include <TMath.h>
28 #include "AliRun.h"
29 
30 
31 // --- MUON includes ---
32 #include "AliMUON.h"
33 #include "AliMUONChamber.h"
34 #include "AliMUONHit.h"
35 #include "AliLog.h"
36 
38 ClassImp(AliMUONChamber)
39 
41 //_______________________________________________________
43  : TObject(),
44  fId(0),
45  fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
46  fResponse(0),
47  fMUON(0)
48 {
50 
51  AliDebug(1, Form("default (empty) ctor this = %p", this));
52 }
53 
54 //_______________________________________________________
56  : TObject(),
57  fId(id),
58  fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
59  fResponse(0),
60  fMUON(0)
61 {
63 
64  // muon
65  fMUON = (AliMUON*)gAlice->GetModule("MUON");
66  if (!fMUON) {
67  AliFatal("MUON detector not defined.");
68  return;
69  }
70 
71  AliDebug(1, Form("ctor this = %p", this) );
72 }
73 
74 //_______________________________________________________
76 {
78 
79  AliDebug(1, Form("dtor this = %p", this));
80  delete fResponse;
81 }
82 
83 //_____________________________________________________
85 {
88 
89  // exponential is here to avoid eventual problems in 0
90  // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
91  fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
92 }
93 
94 //_____________________________________________________________________________
95 void
97 {
98  delete fResponse;
99  fResponse = static_cast<AliMUONResponse*>(thisResponse.Clone());
100 }
101 
MUON tracking chamber class.
AliDetector class for MUON subsystem providing simulation data management.
Definition: AliMUON.h:37
Float_t fCurrentCorrel
! charge correlation for current hit.
AliModule * GetModule(const char *name) const
Definition: AliRun.cxx:191
AliMUONResponse * fResponse
pointer to response
AliRun * gAlice
Definition: AliRun.cxx:62
#define AliFatal(message)
Definition: AliLog.h:640
#define AliDebug(logLevel, message)
Definition: AliLog.h:300
virtual void ChargeCorrelationInit()
Chamber response base class.
AliMUON * fMUON
pointer to MUON
virtual ~AliMUONChamber()
virtual Float_t ChargeCorrel() const
Get the charge correlation (dummy)
virtual void SetResponseModel(const AliMUONResponse &thisResponse)
Set response model.