//
// --- ROOT system ---
-#include "TROOT.h"
-#include "TFile.h"
-#include "TFolder.h"
#include "TTree.h"
-#include "TSystem.h"
#include "TBenchmark.h"
// --- Standard library ---
// --- AliRoot header files ---
#include "AliEMCALTrackSegmentMakerv1.h"
-#include "AliEMCALClusterizerv1.h"
#include "AliEMCALTrackSegment.h"
#include "AliEMCALLink.h"
#include "AliEMCALGetter.h"
-#include "AliEMCAL.h"
ClassImp( AliEMCALTrackSegmentMakerv1)
{
// dtor
// fDefaultInit = kTRUE if TrackSegmentMaker created by default ctor (to get just the parameters)
-
- if (!fDefaultInit) {
- delete fPRELinkArray ;
- delete fHCALinkArray ;
- }
+
}
//____________________________________________________________________________
}
//____________________________________________________________________________
-Float_t AliEMCALTrackSegmentMakerv1::HowClose(AliEMCALTowerRecPoint * ec, AliEMCALTowerRecPoint * rp, Bool_t &toofar)const
+Float_t AliEMCALTrackSegmentMakerv1::HowClose(AliEMCALRecPoint * ec, AliEMCALRecPoint * rp, Bool_t &toofar)const
{
// Calculates the distance between the EMC RecPoint and the PPSD RecPoint
// Clusters are sorted in "rows" and "columns" of width 1 cm
Float_t delta = 10. ; // large enough to be ineffective ??!
- TVector3 vecEC = ec->XYZInAlice() ;
- TVector3 vecRP = rp->XYZInAlice() ;
+ TVector3 vecEC;
+ TVector3 vecRP;
+ ec->GetGlobalPosition(vecEC);
+ rp->GetGlobalPosition(vecRP);
Float_t pro = TMath::Abs(1 - (vecEC * vecRP / ( vecEC.Mag() * vecRP.Mag() ))) ;
toofar = kTRUE ;
if (gDebug == 2 )
- Info("HowClose", "ec = %d, rp = %d pro = %f, toofar=%d", ec->GetIndexInList(), rp->GetIndexInList(), pro, toofar ) ;
+ printf("HowClose: ec = %d, rp = %d pro = %f, toofar=%d", ec->GetIndexInList(), rp->GetIndexInList(), pro, toofar ) ;
return r ;
}
// Make all memory allocations that are not possible in default constructor
AliEMCALGetter* gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName.Data());
-
- fPRELinkArray = new TClonesArray("AliEMCALLink", 1000);
- fHCALinkArray = new TClonesArray("AliEMCALLink", 1000);
+
if ( !gime->TrackSegmentMaker() ) {
gime->PostTrackSegmentMaker(this);
}
void AliEMCALTrackSegmentMakerv1::InitParameters()
{
fClose = 10e-3 ;
- fPRELinkArray = 0 ;
- fHCALinkArray = 0 ;
fTrackSegmentsInRun = 0 ;
}
// which are not further apart from each other than fDangle
// and sort them in accordance with this distance
- AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ /* AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
TObjArray * aECARecPoints = gime->ECARecPoints() ;
- TObjArray * aPRERecPoints = gime->PRERecPoints() ;
- TObjArray * aHCARecPoints = gime->HCARecPoints() ;
+ // TObjArray * aPRERecPoints = gime->PRERecPoints() ;
+ //TObjArray * aHCARecPoints = gime->HCARecPoints() ;
fPRELinkArray->Clear() ;
fHCALinkArray->Clear() ;
- AliEMCALTowerRecPoint * pre ;
- AliEMCALTowerRecPoint * eca ;
- AliEMCALTowerRecPoint * hca ;
+ AliEMCALRecPoint * pre ;
+ AliEMCALRecPoint * eca ;
+ AliEMCALRecPoint * hca ;
Int_t iPRELink = 0 ;
Int_t iHCALink = 0 ;
Int_t iECARP;
for(iECARP = 0; iECARP < aECARecPoints->GetEntriesFast(); iECARP++ ) {
- eca = dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(iECARP)) ;
+ eca = dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(iECARP)) ;
Bool_t toofar = kTRUE ;
Int_t iPRERP = 0 ;
for(iPRERP = 0; iPRERP < aPRERecPoints->GetEntriesFast(); iPRERP++ ) {
- pre = dynamic_cast<AliEMCALTowerRecPoint *>(aPRERecPoints->At(iPRERP)) ;
+ pre = dynamic_cast<AliEMCALRecPoint *>(aPRERecPoints->At(iPRERP)) ;
Float_t prod = HowClose(eca, pre, toofar) ;
if(toofar)
break ;
toofar = kTRUE ;
Int_t iHCARP = 0 ;
for(iHCARP = 0; iHCARP < aHCARecPoints->GetEntriesFast(); iHCARP++ ) {
- hca = dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(iHCARP)) ;
+ hca = dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(iHCARP)) ;
Float_t prod = HowClose(eca, hca, toofar) ;
if(toofar)
break ;
fPRELinkArray->Sort() ; //first links with largest scalar product
fHCALinkArray->Sort() ; //first links with largest scalar product
+ */
}
//____________________________________________________________________________
// unassigned RecParticles. We assign these RecPoints to TrackSegment and
// remove them from the list of "unassigned".
- AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
- TObjArray * aECARecPoints = gime->ECARecPoints() ;
+ /*AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ TObjArray * aECARecPoints = gime->ECARecPoints() ;
TObjArray * aPRERecPoints = gime->PRERecPoints() ;
TObjArray * aHCARecPoints = gime->HCARecPoints() ;
TClonesArray * trackSegments = gime->TrackSegments() ;
for(index = 0; index < nHCA; index ++)
hcaExist[index] = kTRUE ;
- AliEMCALTowerRecPoint * null = 0 ;
+ AliEMCALRecPoint * null = 0 ;
// Finds the smallest links and makes pairs of PRE and ECAL clusters with largest scalar product
TIter nextPRE(fPRELinkArray) ;
if(preExist[linkPRE->GetOther()]){ // PRE still exist
new ((* trackSegments)[fNTrackSegments])
- AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(linkPRE->GetECA())) ,
- dynamic_cast<AliEMCALTowerRecPoint *>(aPRERecPoints->At(linkPRE->GetOther())), null) ;
+ AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(linkPRE->GetECA())) ,
+ dynamic_cast<AliEMCALRecPoint *>(aPRERecPoints->At(linkPRE->GetOther())), null) ;
(dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
fNTrackSegments++ ;
if (gDebug == 2 )
- Info("MakePairs", "ECAL section with PRE section") ;
+ printf("MakePairs: ECAL section with PRE section") ;
ecaExist[linkPRE->GetECA()] = -1 ; //Mark ecal that pre was found
//mark PRE recpoint as already used
preExist[linkPRE->GetOther()] = kFALSE ;
}
}
if (found){
- ts->SetHCARecPoint( dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(linkHCA->GetOther())) ) ;
+ ts->SetHCARecPoint( dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(linkHCA->GetOther())) ) ;
if (gDebug == 2 )
- Info("MakePairs", "ECAL section with PRE and HCAL sections") ;
+ printf("MakePairs: ECAL section with PRE and HCAL sections") ;
}
if (!found) {
new ((* trackSegments)[fNTrackSegments])
- AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(linkHCA->GetECA())), null,
- dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(linkHCA->GetOther()))) ;
+ AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(linkHCA->GetECA())), null,
+ dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(linkHCA->GetOther()))) ;
(dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
fNTrackSegments++ ;
if (gDebug == 2 )
- Info("MakePairs", "ECAL section with HCAL section") ;
+ printf("MakePairs: ECAL section with HCAL section") ;
}
ecaExist[linkHCA->GetECA()] = -2 ; //Mark ecal that hcal was found
//mark HCAL recpoint as already used
for(iECARP = 0; iECARP < nECA ; iECARP++ ){
if(ecaExist[iECARP] > 0 ){
new ((*trackSegments)[fNTrackSegments])
- AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(iECARP)), null, null) ;
+ AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(iECARP)), null, null) ;
(dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
fNTrackSegments++;
if( gDebug == 2 )
- Info("MakePairs", "ECAL section alone") ;
+ printf("MakePairs: ECAL section alone") ;
}
}
}
delete [] ecaExist ;
delete [] preExist ;
delete [] hcaExist ;
+ */
}
//____________________________________________________________________________
if(strstr(option,"tim")){
gBenchmark->Stop("EMCALTSMaker");
- Info("Exec", "took %f seconds for making TS %f seconds per event",
+ printf("Exec: took %f seconds for making TS %f seconds per event",
gBenchmark->GetCpuTime("EMCALTSMaker"), gBenchmark->GetCpuTime("EMCALTSMaker")/nevents) ;
}
Unload();
//____________________________________________________________________________
void AliEMCALTrackSegmentMakerv1::Unload()
{
+ // Unloads the RecPoints and Tracks
AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
gime->EmcalLoader()->UnloadRecPoints() ;
gime->EmcalLoader()->UnloadTracks() ;
{
// Print TrackSegmentMaker parameters
- Info("Print", "TrackSegmentMakerv1 parameters:") ;
+ printf("Print: TrackSegmentMakerv1 parameters:") ;
if( strcmp(GetName(), "") != 0 ) {
printf("Making Track segments with parameters:\n") ;
printf(" Allowed spred on the scalar product of two recpoints with same direction: %f\n", fClose) ;
TClonesArray * trackSegments = AliEMCALGetter::Instance()->TrackSegments() ;
- Info("PrintTrackSegments", "Results from TrackSegmentMaker:") ;
+ printf("PrintTrackSegments: Results from TrackSegmentMaker:") ;
printf("nevent: %d\n", gAlice->GetEvNumber()) ;
printf(" Found %d TrackSegments\n", trackSegments->GetEntriesFast() );
if(strstr(option,"all")) { // printing found TS
- printf("TrackSegment# ECAL RP# PRE RP# HCAL RP# \n") ;
+ printf("TrackSegment# ECAL RP# \n") ;
Int_t index;
for (index = 0 ; index < fNTrackSegments ; index++) {
AliEMCALTrackSegment * ts = (AliEMCALTrackSegment * )trackSegments->At(index) ;
- printf(" %d %d %d %d \n",
- ts->GetIndexInList(), ts->GetECAIndex(), ts->GetPREIndex(), ts->GetHCAIndex() );
+ printf(" %d %d \n",
+ ts->GetIndexInList(), ts->GetECAIndex());
}
}
}