]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 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 | **************************************************************************/ | |
7d62fb64 | 15 | ////////////////////////////////////////////////////////////////////////////// |
16 | // This is the base class for ITS detector signal simulations. Data members // | |
8ba39da9 | 17 | // include are a pointer to the AliITSDetTypeSim clas in order to access // |
18 | // segmentation and response objects // | |
7d62fb64 | 19 | // classes. See the detector specific implementations for the propper code. // |
20 | ////////////////////////////////////////////////////////////////////////////// | |
b361c75d | 21 | #include "TClonesArray.h" |
22 | ||
b0f5e3fc | 23 | #include "AliITSsimulation.h" |
b361c75d | 24 | #include "AliITSpList.h" |
b0f5e3fc | 25 | |
d4a64099 | 26 | ClassImp(AliITSsimulation) |
b0f5e3fc | 27 | |
aacedc3e | 28 | //______________________________________________________________________ |
29 | AliITSsimulation::AliITSsimulation(): TObject(), | |
aacedc3e | 30 | fpList(0), |
31 | fModule(0), | |
32 | fEvent(0), | |
33 | fDebug(0){ | |
34 | // Default constructor | |
35 | // Inputs: | |
36 | // none. | |
37 | // Outputs: | |
38 | // none. | |
39 | // Return: | |
40 | // a default constructed AliITSsimulation class | |
8ba39da9 | 41 | fDetType = 0; |
aacedc3e | 42 | } |
43 | //______________________________________________________________________ | |
8ba39da9 | 44 | AliITSsimulation::AliITSsimulation(AliITSDetTypeSim *dettyp): TObject(), |
aacedc3e | 45 | fpList(0), |
46 | fModule(0), | |
47 | fEvent(0), | |
48 | fDebug(0){ | |
49 | // Default constructor | |
50 | // Inputs: | |
8ba39da9 | 51 | // AliITSDetTypeSim * : object used to access segmentation and response |
aacedc3e | 52 | // Outputs: |
53 | // none. | |
54 | // Return: | |
55 | // a default constructed AliITSsimulation class | |
8ba39da9 | 56 | fDetType = dettyp; |
b361c75d | 57 | } |
58 | //__________________________________________________________________________ | |
59 | AliITSsimulation::~AliITSsimulation(){ | |
60 | // destructor | |
aacedc3e | 61 | // Inputs: |
62 | // none. | |
63 | // Outputs: | |
64 | // none. | |
65 | // Return: | |
66 | // none. | |
67 | ||
8ba39da9 | 68 | if(fpList){ |
69 | delete fpList; | |
70 | fpList = 0; | |
71 | } | |
fcf95fc7 | 72 | } |
b0f5e3fc | 73 | //__________________________________________________________________________ |
ac8cbb66 | 74 | AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s){ |
aacedc3e | 75 | // Copy Constructor |
76 | // Inputs: | |
77 | // const AliITSsimulation &s simulation class to copy from | |
78 | // Outputs: | |
79 | // none. | |
80 | // Return: | |
81 | // a standard constructed AliITSsimulation class with values the same | |
82 | // as that of s. | |
b361c75d | 83 | |
ac8cbb66 | 84 | *this = s; |
b361c75d | 85 | return; |
b0f5e3fc | 86 | } |
87 | ||
88 | //_________________________________________________________________________ | |
ac8cbb66 | 89 | AliITSsimulation& AliITSsimulation::operator=(const AliITSsimulation &s){ |
b361c75d | 90 | // Assignment operator |
aacedc3e | 91 | // Inputs: |
92 | // const AliITSsimulation &s simulation class to copy from | |
93 | // Outputs: | |
94 | // none. | |
95 | // Return: | |
96 | // a standard constructed AliITSsimulation class with values the same | |
97 | // as that of s. | |
b361c75d | 98 | |
ac8cbb66 | 99 | if(&s == this) return *this; |
ac8cbb66 | 100 | this->fModule = s.fModule; |
101 | this->fEvent = s.fEvent; | |
102 | this->fpList = s.fpList; | |
b361c75d | 103 | return *this; |
104 | } | |
105 | //______________________________________________________________________ | |
d4a64099 | 106 | Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){ |
b361c75d | 107 | // Add Summable digits to module maps. |
aacedc3e | 108 | // Inputs: |
109 | // TClonesArray *pItemA Array of AliITSpListItems (SDigits). | |
110 | // Int_t mask Track number off set value (see | |
111 | // AliITSpList::AddItemTo). | |
112 | // Outputs: | |
113 | // none. | |
114 | // Return: | |
115 | // kTRUE if there is a signal >0 else kFALSE | |
b361c75d | 116 | Int_t nItems = pItemA->GetEntries(); |
d4a64099 | 117 | Bool_t sig = kFALSE; |
b361c75d | 118 | |
119 | // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl; | |
120 | for( Int_t i=0; i<nItems; i++ ) { | |
121 | AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i )); | |
122 | if( pItem->GetModule() != fModule ) { | |
123 | Error( "AddSDigitsToModule","Error reading, SDigits module %d " | |
aacedc3e | 124 | "!= current module %d: exit", |
125 | pItem->GetModule(), fModule ); | |
d4a64099 | 126 | return sig; |
b361c75d | 127 | } // end if |
aacedc3e | 128 | if(pItem->GetSignal()>0.0 ) sig = kTRUE; |
b361c75d | 129 | fpList->AddItemTo( mask, pItem ); |
130 | } // end for i | |
d4a64099 | 131 | return sig; |
b0f5e3fc | 132 | } |