// Set all internal pointers to NULL and indices to -1.
Reset();
-};
+}
AliMUONDataInterface::AliMUONDataInterface(const AliMUONDataInterface& rhs)
: TObject(rhs)
if (fRunloader != NULL)
delete fRunloader;
-};
+}
AliMUONDataInterface&
AliMUONDataInterface::operator=(const AliMUONDataInterface& rhs)
fDigitAddressSet = kFALSE;
fClusterAddressSet = kFALSE;
fTriggerAddressSet = kFALSE;
-};
+}
Bool_t AliMUONDataInterface::LoadLoaders(TString filename, TString foldername)
AliError(Form("Could not find or load the run loader for the file: %s and folder: %s",
(const char*)filename, (const char*)foldername));
return kFALSE;
- };
+ }
fMuonloader = fRunloader->GetLoader("MUONLoader");
if (fMuonloader == NULL)
{
(const char*)filename, (const char*)foldername));
fRunloader = NULL;
return kFALSE;
- };
+ }
// Need to connect the muon loader to the AliMUONData object,
// else class to fData will return NULL.
fFoldername = foldername;
fEventnumber = -1; // Reset the event number to force the event to be loaded.
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchLoaders(TString filename, TString foldername)
// Fetch the current file and folder names.
fFilename = fRunloader->GetFileName();
fFoldername = fRunloader->GetEventFolder()->GetName();
- };
+ }
// If filename or foldername are not the same as the ones currently selected then
// reopen the file.
{
delete fRunloader;
return LoadLoaders(filename, foldername);
- };
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchEvent(Int_t event)
fDigitAddressSet = kFALSE;
fClusterAddressSet = kFALSE;
fTriggerAddressSet = kFALSE;
- };
+ }
if ( event != fEventnumber )
{
if ( fRunloader->GetEvent(event) < 0 ) return kFALSE;
fDigitAddressSet = kFALSE;
fClusterAddressSet = kFALSE;
fTriggerAddressSet = kFALSE;
- };
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchTreeK()
{
AliError("Could not load TreeK.");
return kFALSE;
- };
- };
+ }
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchTreeH()
{
AliError("Could not load TreeH.");
return kFALSE;
- };
+ }
fData.SetTreeAddress("H");
fHitAddressSet = kTRUE;
}
{
fData.SetTreeAddress("H");
fHitAddressSet = kTRUE;
- };
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchTreeS()
{
AliError("Could not load TreeS.");
return kFALSE;
- };
+ }
fData.SetTreeAddress("S");
fSDigitAddressSet = kTRUE;
}
{
fData.SetTreeAddress("S");
fSDigitAddressSet = kTRUE;
- };
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchTreeD()
{
AliError("Could not load TreeD.");
return kFALSE;
- };
+ }
fData.SetTreeAddress("D");
fDigitAddressSet = kTRUE;
}
{
fData.SetTreeAddress("D");
fDigitAddressSet = kTRUE;
- };
+ }
return kTRUE;
-};
+}
Bool_t AliMUONDataInterface::FetchTreeR()
{
AliError("Could not load TreeR.");
return kFALSE;
- };
+ }
// Need to reset these flags so that the cluster and trigger address
// gets reset after this method.
fClusterAddressSet = kFALSE;
fTriggerAddressSet = kFALSE;
- };
+ }
return kTRUE;
-};
+}
Int_t AliMUONDataInterface::NumberOfEvents(TString filename, TString foldername)
if ( ! FetchLoaders(filename, foldername) ) return -1;
return fRunloader->GetNumberOfEvents();
-};
+}
Int_t AliMUONDataInterface::NumberOfParticles(TString filename, TString foldername, Int_t event)
if ( ! FetchEvent(event) ) return -1;
if ( ! FetchTreeK() ) return -1;
return (Int_t) fRunloader->TreeK()->GetEntriesFast();
-};
+}
TParticle* AliMUONDataInterface::Particle(
treeK->GetBranch("Particles")->SetAddress(&p);
treeK->GetEvent(particle);
return p;
-};
+}
Int_t AliMUONDataInterface::NumberOfTracks(TString filename, TString foldername, Int_t event)
if ( ! FetchEvent(event) ) return -1;
if ( ! FetchTreeH() ) return -1;
return fData.GetNtracks();
-};
+}
Int_t AliMUONDataInterface::NumberOfHits(
fData.ResetHits();
fData.GetTrack(track);
fTrack = track;
- };
+ }
return fData.Hits()->GetEntriesFast();
-};
+}
AliMUONHit* AliMUONDataInterface::Hit(
fData.ResetHits();
fData.GetTrack(track);
fTrack = track;
- };
+ }
return static_cast<AliMUONHit*>( fData.Hits()->At(hit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfSDigits(
fData.ResetSDigits();
fData.GetCathodeS(cathode);
fSCathode = cathode;
- };
+ }
return fData.SDigits(chamber)->GetEntriesFast();
-};
+}
AliMUONDigit* AliMUONDataInterface::SDigit(
fData.ResetSDigits();
fData.GetCathodeS(cathode);
fSCathode = cathode;
- };
+ }
return static_cast<AliMUONDigit*>( fData.SDigits(chamber)->At(sdigit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfDigits(
fData.ResetDigits();
fData.GetCathode(cathode);
fCathode = cathode;
- };
+ }
return fData.Digits(chamber)->GetEntriesFast();
-};
+}
AliMUONDigit* AliMUONDataInterface::Digit(
fData.ResetDigits();
fData.GetCathode(cathode);
fCathode = cathode;
- };
+ }
return static_cast<AliMUONDigit*>( fData.Digits(chamber)->At(digit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfRawClusters(
fData.ResetRawClusters();
fData.GetRawClusters();
fClusterAddressSet = kTRUE;
- };
+ }
return fData.RawClusters(chamber)->GetEntriesFast();
-};
+}
AliMUONRawCluster* AliMUONDataInterface::RawCluster(
fData.ResetRawClusters();
fData.GetRawClusters();
fClusterAddressSet = kTRUE;
- };
+ }
return static_cast<AliMUONRawCluster*>( fData.RawClusters(chamber)->At(cluster) );
-};
+}
Int_t AliMUONDataInterface::NumberOfLocalTriggers(TString filename, TString foldername, Int_t event)
fData.ResetTrigger();
fData.GetTrigger();
fTriggerAddressSet = kTRUE;
- };
+ }
return fData.LocalTrigger()->GetEntriesFast();
-};
+}
AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(
fData.ResetTrigger();
fData.GetTrigger();
fTriggerAddressSet = kTRUE;
- };
+ }
return static_cast<AliMUONLocalTrigger*>( fData.LocalTrigger()->At(trigger) );
-};
+}
Bool_t AliMUONDataInterface::SetFile(TString filename, TString foldername)
// kTRUE is returned if the run and muon loaders were found, else kFALSE.
return FetchLoaders(filename, foldername);
-};
+}
Bool_t AliMUONDataInterface::GetEvent(Int_t event)
// kTRUE is returned if the event was found, else kFALSE is returned.
return FetchEvent(event);
-};
+}
Int_t AliMUONDataInterface::NumberOfEvents()
{
AliError("File not set.");
return -1;
- };
+ }
return fRunloader->GetNumberOfEvents();
-};
+}
Int_t AliMUONDataInterface::NumberOfParticles()
{
AliError("File not set.");
return -1;
- };
+ }
if ( ! FetchTreeK() ) return -1;
return (Int_t) fRunloader->TreeK()->GetEntriesFast();
-};
+}
TParticle* AliMUONDataInterface::Particle(Int_t particle)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeK() ) return NULL;
TTree* treeK = fRunloader->TreeK();
TParticle* p = NULL;
treeK->GetBranch("Particles")->SetAddress(&p);
treeK->GetEvent(particle);
return p;
-};
+}
Int_t AliMUONDataInterface::NumberOfTracks()
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError( "Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeH() ) return -1;
return fData.GetNtracks();
-};
+}
Int_t AliMUONDataInterface::NumberOfHits(Int_t track)
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeH() ) return -1;
if (fTrack < 0 || fTrack != track)
{
fData.ResetHits();
fData.GetTrack(track);
fTrack = track;
- };
+ }
return fData.Hits()->GetEntriesFast();
-};
+}
AliMUONHit* AliMUONDataInterface::Hit(Int_t track, Int_t hit)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeH() ) return NULL;
if (fTrack < 0 || fTrack != track)
{
fData.ResetHits();
fData.GetTrack(track);
fTrack = track;
- };
+ }
return static_cast<AliMUONHit*>( fData.Hits()->At(hit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfSDigits(Int_t chamber, Int_t cathode)
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeS() ) return -1;
if ( fSCathode != cathode )
fData.ResetSDigits();
fData.GetCathodeS(cathode);
fSCathode = cathode;
- };
+ }
return fData.SDigits(chamber)->GetEntriesFast();
-};
+}
AliMUONDigit* AliMUONDataInterface::SDigit(Int_t chamber, Int_t cathode, Int_t sdigit)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeS() ) return NULL;
if ( fSCathode != cathode )
fData.ResetSDigits();
fData.GetCathodeS(cathode);
fSCathode = cathode;
- };
+ }
return static_cast<AliMUONDigit*>( fData.SDigits(chamber)->At(sdigit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfDigits(Int_t chamber, Int_t cathode)
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeD() ) return -1;
if ( fCathode != cathode )
fData.ResetDigits();
fData.GetCathode(cathode);
fCathode = cathode;
- };
+ }
return fData.Digits(chamber)->GetEntriesFast();
-};
+}
AliMUONDigit* AliMUONDataInterface::Digit(Int_t chamber, Int_t cathode, Int_t digit)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeD() ) return NULL;
if ( fCathode != cathode )
fData.ResetDigits();
fData.GetCathode(cathode);
fCathode = cathode;
- };
+ }
return static_cast<AliMUONDigit*>( fData.Digits(chamber)->At(digit) );
-};
+}
Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t chamber)
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeR() ) return -1;
if ( ! fClusterAddressSet )
fData.ResetRawClusters();
fData.GetRawClusters();
fClusterAddressSet = kTRUE;
- };
+ }
return fData.RawClusters(chamber)->GetEntriesFast();
-};
+}
AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t chamber, Int_t cluster)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeR() ) return NULL;
if ( ! fClusterAddressSet )
fData.ResetRawClusters();
fData.GetRawClusters();
fClusterAddressSet = kTRUE;
- };
+ }
return static_cast<AliMUONRawCluster*>( fData.RawClusters(chamber)->At(cluster) );
-};
+}
Int_t AliMUONDataInterface::NumberOfLocalTriggers()
{
AliError("File not set.");
return -1;
- };
+ }
if (fEventnumber < 0)
{
AliError("Event not chosen.");
return -1;
- };
+ }
if ( ! FetchTreeR() ) return -1;
if ( ! fTriggerAddressSet )
fData.ResetTrigger();
fData.GetTrigger();
fTriggerAddressSet = kTRUE;
- };
+ }
return fData.LocalTrigger()->GetEntriesFast();
-};
+}
AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t trigger)
{
AliError("File not set.");
return NULL;
- };
+ }
if (fEventnumber < 0)
{
AliError( "Event not chosen.");
return NULL;
- };
+ }
if ( ! FetchTreeR() ) return NULL;
if ( ! fTriggerAddressSet )
fData.ResetTrigger();
fData.GetTrigger();
fTriggerAddressSet = kTRUE;
- };
+ }
return static_cast<AliMUONLocalTrigger*>( fData.LocalTrigger()->At(trigger) );
-};
+}