]>
Commit | Line | Data |
---|---|---|
30178c30 | 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$ */ | |
cf286af7 | 17 | |
18 | ///////////////////////////////////////////////////////////////////////////////// | |
19 | // | |
20 | // AliMUONSDigitizerv1 digitizes hits from the input stream into s-digits. | |
21 | // The s-digits are written to the s-digit tree TreeS. | |
22 | // The same algorithm is implemented as for AliMUONDigitizerv1 however the | |
23 | // chamber response is not applied to the s-digits and we write to TreeS and | |
24 | // not TreeD. | |
25 | // | |
26 | ///////////////////////////////////////////////////////////////////////////////// | |
d1775029 | 27 | |
30178c30 | 28 | #include "AliMUONSDigitizerv1.h" |
29 | #include "AliMUONLoader.h" | |
30 | #include "AliMUONData.h" | |
31 | #include "AliMUONDigit.h" | |
32 | #include "AliMUONTransientDigit.h" | |
33 | ||
d1775029 | 34 | ClassImp(AliMUONSDigitizerv1) |
35 | ||
36 | //___________________________________________ | |
30178c30 | 37 | AliMUONSDigitizerv1::AliMUONSDigitizerv1() |
38 | : AliMUONDigitizerv1() | |
d1775029 | 39 | { |
cf286af7 | 40 | // Default ctor - don't use it |
d1775029 | 41 | } |
42 | ||
cf286af7 | 43 | //___________________________________________ |
30178c30 | 44 | AliMUONSDigitizerv1::AliMUONSDigitizerv1(AliRunDigitizer* manager) |
45 | : AliMUONDigitizerv1(manager) | |
d1775029 | 46 | { |
cf286af7 | 47 | // ctor which should be used |
d1775029 | 48 | } |
49 | ||
8789635b | 50 | //___________________________________________ |
51 | AliMUONSDigitizerv1::~AliMUONSDigitizerv1() | |
52 | { | |
53 | // Destructor | |
54 | } | |
55 | ||
d1775029 | 56 | //------------------------------------------------------------------------ |
cf286af7 | 57 | void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[6]) |
d1775029 | 58 | { |
cf286af7 | 59 | // Derived to write to the s-digit tree TreeS. |
d1775029 | 60 | |
30178c30 | 61 | fMUONData->AddSDigit(chamber, tracks, charges, digits); |
cf286af7 | 62 | }; |
d1775029 | 63 | |
64 | //------------------------------------------------------------------------ | |
cf286af7 | 65 | Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td) |
d1775029 | 66 | { |
cf286af7 | 67 | // Returns the transient digit signal as is without applying the chamber response. |
d1775029 | 68 | |
cf286af7 | 69 | if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal."); |
70 | return td->Signal(); | |
71 | }; | |
d1775029 | 72 | |
73 | //------------------------------------------------------------------------ | |
cf286af7 | 74 | Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader) |
d1775029 | 75 | { |
cf286af7 | 76 | // Overridden to initialise the output tree to be TreeS rather than TreeD. |
77 | ||
78 | if (GetDebug() > 2) | |
79 | Info("InitOutputData", "Creating s-digits branch and setting the tree address."); | |
80 | ||
30178c30 | 81 | fMUONData->SetLoader(muonloader); |
cf286af7 | 82 | |
83 | // New branch per chamber for MUON digit in the tree of digits | |
84 | if (muonloader->TreeS() == NULL) | |
85 | { | |
86 | muonloader->MakeSDigitsContainer(); | |
87 | if (muonloader->TreeS() == NULL) | |
88 | { | |
89 | Error("InitOutputData", "Could not create TreeS."); | |
90 | return kFALSE; | |
91 | }; | |
92 | }; | |
93 | ||
30178c30 | 94 | fMUONData->MakeBranch("S"); |
95 | fMUONData->SetTreeAddress("S"); | |
d1775029 | 96 | |
cf286af7 | 97 | return kTRUE; |
98 | }; | |
d1775029 | 99 | |
cf286af7 | 100 | //------------------------------------------------------------------------ |
101 | void AliMUONSDigitizerv1::FillOutputData() | |
102 | { | |
103 | // Overridden to fill TreeS rather than TreeD. | |
d1775029 | 104 | |
cf286af7 | 105 | if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits."); |
30178c30 | 106 | fMUONData->Fill("S"); |
107 | fMUONData->ResetSDigits(); | |
cf286af7 | 108 | }; |
d1775029 | 109 | |
d1775029 | 110 | //------------------------------------------------------------------------ |
cf286af7 | 111 | void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader) |
d1775029 | 112 | { |
cf286af7 | 113 | // Overridden to write and then cleanup TreeS that was initialised in InitOutputData. |
114 | ||
115 | if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers."); | |
116 | muonloader->WriteSDigits("OVERWRITE"); | |
30178c30 | 117 | fMUONData->ResetSDigits(); |
cf286af7 | 118 | muonloader->UnloadSDigits(); |
119 | }; |