3 #include <TDirectory.h>
11 #include "AliRunLoader.h"
12 #include "AliLoader.h"
15 #include "AliMUONChamber.h"
16 #include "AliMUONConstants.h"
17 #include "AliMUONDigit.h"
18 #include "AliMUONSDigitizerv1.h"
19 #include "AliMUONHit.h"
20 #include "AliMUONHitMapA1.h"
21 #include "AliMUONPadHit.h"
22 #include "AliMUONTransientDigit.h"
24 /////////////////////////////////////////////////////////////////////////////////
26 // AliMUONSDigitizerv1 digitizes hits from the input stream into s-digits.
27 // The s-digits are written to the s-digit tree TreeS.
28 // The same algorithm is implemented as for AliMUONDigitizerv1 however the
29 // chamber response is not applied to the s-digits and we write to TreeS and
32 /////////////////////////////////////////////////////////////////////////////////
34 ClassImp(AliMUONSDigitizerv1)
36 //___________________________________________
37 AliMUONSDigitizerv1::AliMUONSDigitizerv1() : AliMUONDigitizerv1()
39 // Default ctor - don't use it
42 //___________________________________________
43 AliMUONSDigitizerv1::AliMUONSDigitizerv1(AliRunDigitizer* manager) : AliMUONDigitizerv1(manager)
45 // ctor which should be used
48 //___________________________________________
49 AliMUONSDigitizerv1::~AliMUONSDigitizerv1()
54 //------------------------------------------------------------------------
55 void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[6])
57 // Derived to write to the s-digit tree TreeS.
59 muondata->AddSDigit(chamber, tracks, charges, digits);
62 //------------------------------------------------------------------------
63 Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
65 // Returns the transient digit signal as is without applying the chamber response.
67 if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal.");
71 //------------------------------------------------------------------------
72 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
74 // Overridden to initialise the output tree to be TreeS rather than TreeD.
77 Info("InitOutputData", "Creating s-digits branch and setting the tree address.");
79 muondata->SetLoader(muonloader);
81 // New branch per chamber for MUON digit in the tree of digits
82 if (muonloader->TreeS() == NULL)
84 muonloader->MakeSDigitsContainer();
85 if (muonloader->TreeS() == NULL)
87 Error("InitOutputData", "Could not create TreeS.");
92 muondata->MakeBranch("S");
93 muondata->SetTreeAddress("S");
98 //------------------------------------------------------------------------
99 void AliMUONSDigitizerv1::FillOutputData()
101 // Overridden to fill TreeS rather than TreeD.
103 if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits.");
105 muondata->ResetSDigits();
108 //------------------------------------------------------------------------
109 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
111 // Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
113 if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers.");
114 muonloader->WriteSDigits("OVERWRITE");
115 muondata->ResetSDigits();
116 muonloader->UnloadSDigits();