/* $Id$ */
+// ----------------------------
+// Class AliMUONClusterInput
+// ----------------------------
+// Global data service for hit reconstruction
+// Author: to be added
+
#include "AliMUONClusterInput.h"
-#include "AliMUON.h"
+#include "AliMUONGeometryTransformer.h"
+#include "AliMUONGeometrySegmentation.h"
+#include "AliMUONSegFactory.h"
#include "AliMUONSegmentation.h"
#include "AliMUONConstants.h"
#include "AliMUONMathieson.h"
#include "AliMUONRawCluster.h"
#include "AliMUONDigit.h"
-#include "AliRun.h"
#include "AliLog.h"
#include <TClonesArray.h>
#include <TMinuit.h>
+#include <TGeoManager.h>
-AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
-TMinuit* AliMUONClusterInput::fgMinuit = 0;
-AliMUONMathieson* AliMUONClusterInput::fgMathieson = 0;
+AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
+TMinuit* AliMUONClusterInput::fgMinuit = 0;
+AliMUONMathieson* AliMUONClusterInput::fgMathieson = 0;
+AliMUONGeometryTransformer* AliMUONClusterInput::fgTransformer = 0;
+AliMUONSegmentation* AliMUONClusterInput::fgSegmentation = 0;
ClassImp(AliMUONClusterInput)
AliMUONClusterInput::AliMUONClusterInput()
: TObject(),
+ fNseg(0),
+ fChamber(0),
fCluster(0),
+ fZ(0.),
fChargeCorrel(1.),
fDetElemId(0)
{
+// Default constructor
+
fDigits[0]=0;
fDigits[1]=0;
fSegmentation2[0]=0;
if (fgClusterInput == 0) {
fgClusterInput = new AliMUONClusterInput();
fgMinuit = new TMinuit(8);
+
+ // Create segmentation with activated Root geometry
+ if ( ! gGeoManager ) {
+ AliFatalClass("Geometry not loaded.");
+ return fgClusterInput;
+ }
+ fgTransformer = new AliMUONGeometryTransformer(true);
+ fgTransformer->ReadGeometryData("volpath.dat", gGeoManager);
+ AliMUONSegFactory factory(fgTransformer);
+ fgSegmentation = factory.CreateSegmentation();
}
return fgClusterInput;
// Destructor
delete fgMinuit;
delete fgMathieson;
-}
-
-AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput):TObject(clusterInput)
-{
-// Protected copy constructor
-
- AliFatal("Not implemented.");
+ delete fgTransformer;
+ delete fgSegmentation;
+ fgMinuit = 0;
+ fgMathieson = 0;
}
void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig1, TClonesArray* dig2)
fNDigits[0] = dig1->GetEntriesFast();
fNDigits[1] = dig2->GetEntriesFast();
+ delete fgMathieson;
fgMathieson = new AliMUONMathieson();
- AliMUON *pMUON;
- AliMUONSegmentation* pSegmentation;
-
- pMUON = (AliMUON*) gAlice->GetModule("MUON");
- pSegmentation = pMUON->GetSegmentation();
- fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0);
- fSegmentation2[1]= pSegmentation->GetModuleSegmentation(chamber, 1);
+ fSegmentation2[0]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 0);
+ fSegmentation2[1]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 1);
fNseg = 2;
if (chamber < AliMUONConstants::NTrackingCh()) {
fDetElemId = idDE;
fDigits[0] = dig;
- AliMUON *pMUON;
- AliMUONSegmentation* pSegmentation;
-
- pMUON = (AliMUON*) gAlice->GetModule("MUON");
- pSegmentation = pMUON->GetSegmentation();
- fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0);
-
+ fSegmentation2[0]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 0);
fNseg=1;
}
// par[0] x-position of cluster
// par[1] y-position of cluster
- Float_t q1;
- fSegmentation2[cath]->SetPad(fDetElemId, fix[i][cath], fiy[i][cath]);
- // First Cluster
- fSegmentation2[cath]->SetHit(fDetElemId, par[0],par[1],fZ);
- q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
+ Float_t q1;
+ fSegmentation2[cath]-> SetPad(fDetElemId, fix[i][cath], fiy[i][cath]);
+ // First Cluster
+ fSegmentation2[cath]-> SetHit(fDetElemId, par[0],par[1],fZ);
+ q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
Float_t value = fQtot[cath]*q1;
return value;