1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
6 * for The ALICE HLT Project. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 #include "AliHLTPHOSDigitHandler.h"
18 #include "AliRunLoader.h"
19 #include "AliLoader.h"
20 #include "AliHLTPHOSGeometry.h"
22 #include "AliPHOSDigit.h"
24 AliHLTPHOSDigitHandler *AliHLTPHOSDigitHandler::fgkInstance = NULL;
26 AliHLTPHOSDigitHandler::AliHLTPHOSDigitHandler() : AliHLTCaloDigitHandler("PHOS")
31 AliHLTPHOSDigitHandler::~AliHLTPHOSDigitHandler()
36 AliHLTPHOSDigitHandler* AliHLTPHOSDigitHandler::Instance()
40 fgkInstance = new AliHLTPHOSDigitHandler;
45 Int_t AliHLTPHOSDigitHandler::Init(AliRunLoader* runLoader)
48 fGeometry = new AliHLTPHOSGeometry();
49 if(fGeometry) fGeometry->InitialiseGeometry();
51 Int_t nev = AliHLTCaloDigitHandler::Init(runLoader);
56 fDetLoader = fRunLoader->GetDetectorLoader("PHOS");
59 HLTFatal("Could not get PHOS loader");
71 Int_t AliHLTPHOSDigitHandler::ConvertDigit(AliDigitNew* digit)
73 AliPHOSDigit *dig = dynamic_cast<AliPHOSDigit*>(digit);
76 HLTError("Wrong data, cannot create digits");
84 fGeometry->GetLocalCoordinatesFromAbsId(dig->GetId(), module, x, z);
86 AliHLTCaloDigitDataStruct *hDig = &(fDigits[module][fDigitsInModule[module]]);
88 hDig->fID = dig->GetId();
91 hDig->fModule = module;
92 hDig->fEnergy = dig->GetEnergy();
93 hDig->fTime = dig->GetTime();
95 hDig->fOverflow = false;
96 hDig->fHgPresent = true;
97 hDig->fAssociatedCluster = -1;
98 fDigitsInModule[module]++;