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 void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[6])
51 // Derived to write to the s-digit tree TreeS.
53 muondata->AddSDigit(chamber, tracks, charges, digits);
56 //------------------------------------------------------------------------
57 Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
59 // Returns the transient digit signal as is without applying the chamber response.
61 if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal.");
65 //------------------------------------------------------------------------
66 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
68 // Overridden to initialise the output tree to be TreeS rather than TreeD.
71 Info("InitOutputData", "Creating s-digits branch and setting the tree address.");
73 muondata->SetLoader(muonloader);
75 // New branch per chamber for MUON digit in the tree of digits
76 if (muonloader->TreeS() == NULL)
78 muonloader->MakeSDigitsContainer();
79 if (muonloader->TreeS() == NULL)
81 Error("InitOutputData", "Could not create TreeS.");
86 muondata->MakeBranch("S");
87 muondata->SetTreeAddress("S");
92 //------------------------------------------------------------------------
93 void AliMUONSDigitizerv1::FillOutputData()
95 // Overridden to fill TreeS rather than TreeD.
97 if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits.");
99 muondata->ResetSDigits();
102 //------------------------------------------------------------------------
103 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
105 // Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
107 if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers.");
108 muonloader->WriteSDigits("OVERWRITE");
109 muondata->ResetSDigits();
110 muonloader->UnloadSDigits();