/* $Id$ */
-#include <Riostream.h>
-#include <TClonesArray.h>
-#include <TArrayS.h>
-#include <TArrayD.h>
+// -------------------------------------
+// Class AliMUONEventRecoCombi
+// -------------------------------------
+// Steering class for the combined cluster / track reconstructor
+// Author: Alexander Zinchenko, JINR Dubna
+
#include "AliMUONEventRecoCombi.h"
+
#include "AliMUONData.h"
#include "AliMUONDetElement.h"
#include "AliMUONDigit.h"
#include "AliMUONHitForRec.h"
#include "AliMUONRawCluster.h"
#include "AliMUONTrackK.h"
-#include "AliMUONTrackReconstructor.h"
+#include "AliMUONTrackReconstructorK.h"
#include "AliMUONConstants.h"
+
#include "AliLoader.h"
+#include "AliLog.h"
+#include <Riostream.h>
+#include <TClonesArray.h>
+#include <TArrayS.h>
+#include <TArrayD.h>
+
+/// \cond CLASSIMP
ClassImp(AliMUONEventRecoCombi)
+/// \endcond
AliMUONEventRecoCombi* AliMUONEventRecoCombi::fgRecoCombi = 0;
//_________________________________________________________________________
-AliMUONEventRecoCombi::AliMUONEventRecoCombi() : TObject()
+AliMUONEventRecoCombi::AliMUONEventRecoCombi()
+ : TObject(),
+ fDetElems(0x0),
+ fZ(new TArrayD(20)),
+ fNZ(0),
+ fDEvsZ(0x0)
{
- // Ctor
+ /// Ctor
fDetElems = new TClonesArray("AliMUONDetElement", 20);
- fZ = new TArrayD(20);
- fNZ = 0;
- fDEvsZ = NULL;
}
//_________________________________________________________________________
AliMUONEventRecoCombi* AliMUONEventRecoCombi::Instance()
{
-// return pointer to the singleton instance
+/// Return pointer to the singleton instance
if (fgRecoCombi == 0) {
fgRecoCombi = new AliMUONEventRecoCombi();
}
- //fDetElems = new TClonesArray("AliMUONDetElement", 20);
- //fZ = new TArrayD(20);
- //fNZ = 0;
return fgRecoCombi;
}
//_________________________________________________________________________
AliMUONEventRecoCombi::~AliMUONEventRecoCombi()
{
- // Destructor
+ /// Destructor
delete fDetElems;
delete fZ;
delete [] fDEvsZ;
//_________________________________________________________________________
void AliMUONEventRecoCombi::FillEvent(AliMUONData *data, AliMUONClusterFinderAZ *recModel)
{
- // Fill event information
+ /// Fill event information
// Clear previous event
fDetElems->Delete();
for (Int_t ich = 0; ich < 6; ich++) {
// loop over chambers 0-5
TClonesArray *digs = data->Digits(ich);
+ digs->Sort(); //AZ
//cout << ich << " " << digs << " " << digs->GetEntriesFast() << endl;
Int_t idDE = -1;
for (Int_t i = 0; i < digs->GetEntriesFast(); i++) {
}
}
+ // Compute average Z-position
+ for (Int_t i = 0; i < nDetElem; i++) {
+ AliMUONDetElement *detElem = (AliMUONDetElement*) fDetElems->UncheckedAt(i);
+ Int_t nDigs = detElem->Digits(0)->GetEntriesFast() +
+ detElem->Digits(1)->GetEntriesFast();
+ detElem->SetZ(detElem->Z() / nDigs);
+ }
+
// Sort according to Z
fDetElems->Sort();
//cout << nDetElem << endl;
for (Int_t i = 0; i < nDetElem; i++) {
AliMUONDetElement *detElem = (AliMUONDetElement*) fDetElems->UncheckedAt(i);
detElem->Fill(data);
- //cout << i << " " << detElem->Z() << endl;
- if (detElem->Z() - z0 < 0.5) {
+ //cout << i << " " << detElem->IdDE() << " " << detElem->Z() << endl;
+ if (detElem->Z() - z0 < 0.05) {
// the same Z
(*nPerZ)[fNZ]++;
} else {
- if (fZ->GetSize() <= fNZ) fZ->Set(fZ->GetSize()+10);
- if (nPerZ->GetSize() <= fNZ) nPerZ->Set(nPerZ->GetSize()+10);
+ if (fZ->GetSize() <= fNZ+1) fZ->Set(fZ->GetSize()+10);
+ if (nPerZ->GetSize() <= fNZ+1) nPerZ->Set(nPerZ->GetSize()+10);
(*fZ)[++fNZ] = detElem->Z();
z0 = detElem->Z();
(*nPerZ)[fNZ]++;
// Fill rec. point container for stations 4 and 5
//cout << data->TreeR() << endl;
//data->MakeBranch("RC");
+ /*
data->SetTreeAddress("RCC");
for (Int_t ch = 6; ch < 10; ch++) {
TClonesArray *raw = data->RawClusters(ch);
- //cout << raw->GetEntriesFast() << " " << data->RawClusters(ch) << endl;
- for (Int_t i = 0; i < raw->GetEntriesFast(); i++) {
+ cout << ch << " " << raw->GetEntriesFast() << " " << data->RawClusters(ch) << endl;
+ //for (Int_t i = 0; i < raw->GetEntriesFast(); i++) {
+ for (Int_t i = 0; i < TMath::Min(raw->GetEntriesFast(),1000); i++) {
AliMUONRawCluster *clus = (AliMUONRawCluster*) raw->UncheckedAt(i);
data->AddRawCluster(ch, *clus);
+ cout << i << " " << raw->GetEntriesFast() << endl;
}
}
+ */
//data->SetTreeAddress("RC");
}
//_________________________________________________________________________
-void AliMUONEventRecoCombi::FillRecP(AliMUONData *dataCluster, AliMUONTrackReconstructor *recoTrack)
+void AliMUONEventRecoCombi::FillRecP(AliMUONData *dataCluster, AliMUONTrackReconstructorK *recoTrack) const
{
- // Fill rec. points used for tracking from det. elems
+ /// Fill rec. points used for tracking from det. elems
TClonesArray *tracks = recoTrack->GetRecTracksPtr();
for (Int_t i = 0; i < recoTrack->GetNRecTracks(); i++) {
AliMUONTrackK *track = (AliMUONTrackK*) tracks->UncheckedAt(i);
- TObjArray *hits = track->GetHitOnTrack();
+ TObjArray *hits = track->GetTrackHits();
for (Int_t j = 0; j < track->GetNTrackHits(); j++) {
AliMUONHitForRec *hit = (AliMUONHitForRec*) hits->UncheckedAt(j);
if (hit->GetHitNumber() >= 0) continue;
//_________________________________________________________________________
Int_t AliMUONEventRecoCombi::IZfromHit(AliMUONHitForRec *hit) const
{
- // Get Iz of det. elem. from the hit
+ /// Get Iz of det. elem. from the hit
Int_t index = -hit->GetHitNumber() / 100000 - 1, iz0 = -1;
for (Int_t iz = 0; iz < fNZ; iz++) {