1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /////////////////////////////////////////////////////////////////////////////////
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
26 /////////////////////////////////////////////////////////////////////////////////
28 #include "AliMUONSDigitizerv1.h"
29 #include "AliMUONLoader.h"
30 #include "AliMUONData.h"
31 #include "AliMUONDigit.h"
32 #include "AliMUONTransientDigit.h"
35 ClassImp(AliMUONSDigitizerv1)
37 //___________________________________________
38 AliMUONSDigitizerv1::AliMUONSDigitizerv1()
39 : AliMUONDigitizerv1()
41 // Default ctor - don't use it
44 //___________________________________________
45 AliMUONSDigitizerv1::AliMUONSDigitizerv1(AliRunDigitizer* manager)
46 : AliMUONDigitizerv1(manager)
48 // ctor which should be used
51 //___________________________________________
52 AliMUONSDigitizerv1::~AliMUONSDigitizerv1()
57 //------------------------------------------------------------------------
58 void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[7])
60 // Derived to write to the s-digit tree TreeS.
62 fMUONData->AddSDigit(chamber, tracks, charges, digits);
65 //------------------------------------------------------------------------
66 Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
68 // Returns the transient digit signal as is without applying the chamber response.
69 AliDebug(4,"Returning TransientDigit signal.");
73 //------------------------------------------------------------------------
74 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
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.");
79 fMUONData->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 AliError("Could not create TreeS.");
92 fMUONData->MakeBranch("S");
93 fMUONData->SetTreeAddress("S");
98 //------------------------------------------------------------------------
99 void AliMUONSDigitizerv1::FillOutputData()
101 // Overridden to fill TreeS rather than TreeD.
103 AliDebug(3,"Filling trees with s-digits.");
104 fMUONData->Fill("S");
105 fMUONData->ResetSDigits();
108 //------------------------------------------------------------------------
109 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
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();