]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONSDigitizerv1.cxx
Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / MUON / AliMUONSDigitizerv1.cxx
... / ...
CommitLineData
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//
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/////////////////////////////////////////////////////////////////////////////////
27
28#include "AliMUONSDigitizerv1.h"
29#include "AliMUONLoader.h"
30#include "AliMUONData.h"
31#include "AliMUONDigit.h"
32#include "AliMUONTransientDigit.h"
33#include "AliLog.h"
34
35ClassImp(AliMUONSDigitizerv1)
36
37//___________________________________________
38AliMUONSDigitizerv1::AliMUONSDigitizerv1()
39 : AliMUONDigitizerv1()
40{
41 // Default ctor - don't use it
42}
43
44//___________________________________________
45AliMUONSDigitizerv1::AliMUONSDigitizerv1(AliRunDigitizer* manager)
46 : AliMUONDigitizerv1(manager)
47{
48 // ctor which should be used
49}
50
51//___________________________________________
52AliMUONSDigitizerv1::~AliMUONSDigitizerv1()
53{
54 // Destructor
55}
56
57//------------------------------------------------------------------------
58void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[6])
59{
60// Derived to write to the s-digit tree TreeS.
61
62 fMUONData->AddSDigit(chamber, tracks, charges, digits);
63};
64
65//------------------------------------------------------------------------
66Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
67{
68// Returns the transient digit signal as is without applying the chamber response.
69 AliDebug(4,"Returning TransientDigit signal.");
70 return td->Signal();
71};
72
73//------------------------------------------------------------------------
74Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
75{
76// Overridden to initialise the output tree to be TreeS rather than TreeD.
77 AliDebug(3,"Creating s-digits branch and setting the tree address.");
78
79 fMUONData->SetLoader(muonloader);
80
81 // New branch per chamber for MUON digit in the tree of digits
82 if (muonloader->TreeS() == NULL)
83 {
84 muonloader->MakeSDigitsContainer();
85 if (muonloader->TreeS() == NULL)
86 {
87 AliError("Could not create TreeS.");
88 return kFALSE;
89 };
90 };
91
92 fMUONData->MakeBranch("S");
93 fMUONData->SetTreeAddress("S");
94
95 return kTRUE;
96};
97
98//------------------------------------------------------------------------
99void AliMUONSDigitizerv1::FillOutputData()
100{
101// Overridden to fill TreeS rather than TreeD.
102
103 AliDebug(3,"Filling trees with s-digits.");
104 fMUONData->Fill("S");
105 fMUONData->ResetSDigits();
106};
107
108//------------------------------------------------------------------------
109void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
110{
111// Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
112 AliDebug(3,"Writing s-digits and releasing pointers.");
113 muonloader->WriteSDigits("OVERWRITE");
114 fMUONData->ResetSDigits();
115 muonloader->UnloadSDigits();
116};