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"
34 ClassImp(AliMUONSDigitizerv1)
36 //___________________________________________
37 AliMUONSDigitizerv1::AliMUONSDigitizerv1()
38 : AliMUONDigitizerv1()
40 // Default ctor - don't use it
43 //___________________________________________
44 AliMUONSDigitizerv1::AliMUONSDigitizerv1(AliRunDigitizer* manager)
45 : AliMUONDigitizerv1(manager)
47 // ctor which should be used
50 //___________________________________________
51 AliMUONSDigitizerv1::~AliMUONSDigitizerv1()
56 //------------------------------------------------------------------------
57 void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_t charges[kMAXTRACKS], Int_t digits[6])
59 // Derived to write to the s-digit tree TreeS.
61 fMUONData->AddSDigit(chamber, tracks, charges, digits);
64 //------------------------------------------------------------------------
65 Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
67 // Returns the transient digit signal as is without applying the chamber response.
69 if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal.");
73 //------------------------------------------------------------------------
74 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
76 // Overridden to initialise the output tree to be TreeS rather than TreeD.
79 Info("InitOutputData", "Creating s-digits branch and setting the tree address.");
81 fMUONData->SetLoader(muonloader);
83 // New branch per chamber for MUON digit in the tree of digits
84 if (muonloader->TreeS() == NULL)
86 muonloader->MakeSDigitsContainer();
87 if (muonloader->TreeS() == NULL)
89 Error("InitOutputData", "Could not create TreeS.");
94 fMUONData->MakeBranch("S");
95 fMUONData->SetTreeAddress("S");
100 //------------------------------------------------------------------------
101 void AliMUONSDigitizerv1::FillOutputData()
103 // Overridden to fill TreeS rather than TreeD.
105 if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits.");
106 fMUONData->Fill("S");
107 fMUONData->ResetSDigits();
110 //------------------------------------------------------------------------
111 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
113 // Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
115 if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers.");
116 muonloader->WriteSDigits("OVERWRITE");
117 fMUONData->ResetSDigits();
118 muonloader->UnloadSDigits();