]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add the array of crates Id
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:16:47 +0000 (11:16 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:16:47 +0000 (11:16 +0000)
(Christian)

MUON/mapping/AliMpDDL.cxx
MUON/mapping/AliMpDDL.h

index 6ec176433379bba727af54979d875ccaf72f3811..1426477a48bc85bd814b1f3fa0c5ea4d7373378e 100644 (file)
@@ -41,7 +41,9 @@ AliMpDDL::AliMpDDL(Int_t id)
   : TObject(),
     fId(id),
     fDEIds(),
-    fBusPatchIds()
+    fBusPatchIds(),
+    fTriggerCrateIds(false)
+
 {
 /// Standard constructor
 }
@@ -51,7 +53,8 @@ AliMpDDL::AliMpDDL(TRootIOCtor* /*ioCtor*/)
   : TObject(),
     fId(0),
     fDEIds(),
-    fBusPatchIds()
+    fBusPatchIds(),
+    fTriggerCrateIds()
 {
 /// Root IO constructor
 }
@@ -105,6 +108,24 @@ Bool_t AliMpDDL::AddDE(Int_t detElemId)
   return true;
 }   
 
+//______________________________________________________________________________
+Bool_t AliMpDDL::AddTriggerCrate(Int_t crateId)
+{
+/// Add trigger crate with given crateId.
+/// Return true if the trigger crate was added
+
+  if ( HasTriggerCrateId(crateId) ) {
+    AliWarningStream() 
+       << "Trigger crate Id = " << crateId << " already present."
+       << endl;
+    return false;
+  }    
+  
+  fTriggerCrateIds.Add(crateId);
+
+  return true;
+}      
+
 //______________________________________________________________________________
 Int_t AliMpDDL::GetNofDEs() const
 {  
@@ -153,6 +174,30 @@ Bool_t  AliMpDDL::HasBusPatchId(Int_t busPatchId) const
   return fBusPatchIds.HasValue(busPatchId);; 
 }
 
+//______________________________________________________________________________
+Int_t AliMpDDL::GetNofTriggerCrates() const
+{  
+/// Return the number of trigger crate connected to this DDL
+
+  return fTriggerCrateIds.GetSize(); 
+}
+
+//______________________________________________________________________________
+Int_t  AliMpDDL::GetTriggerCrateId(Int_t index) const
+{  
+/// Return the trigger crate by index (in loop)
+
+  return fTriggerCrateIds.GetValue(index); 
+}
+
+//______________________________________________________________________________
+Bool_t  AliMpDDL::HasTriggerCrateId(Int_t triggerCrateId) const
+{  
+/// Return true if the trigger crate Id is present
+
+  return fTriggerCrateIds.HasValue(triggerCrateId);
+}
+
 //____________________________________________________________________
 Int_t AliMpDDL::GetMaxDsp() const
 {
index 238ec598de539967b2433a573746f23e995b85d9..e5190fca5ce5b940bacdd7de0d8c4b13fd37f2a0 100644 (file)
@@ -26,6 +26,8 @@ class AliMpDDL : public  TObject {
 
     // methods 
     Bool_t AddDE(Int_t detElemId);
+    Bool_t AddTriggerCrate(Int_t crateId);
+
     void   FillBusPatchIds();
 
     // get methods
@@ -40,6 +42,11 @@ class AliMpDDL : public  TObject {
     Int_t  GetNofBusPatches() const;
     Int_t  GetBusPatchId(Int_t index) const;
     Bool_t HasBusPatchId(Int_t busPatchId) const;
+
+    // Trigger crates
+    Int_t  GetNofTriggerCrates() const;
+    Int_t  GetTriggerCrateId(Int_t index) const;
+    Bool_t HasTriggerCrateId(Int_t crateId) const;
     
     // Dsp info
     Int_t  GetMaxDsp() const;
@@ -54,10 +61,11 @@ class AliMpDDL : public  TObject {
     AliMpDDL& operator=(const AliMpDDL& rhs);
 
     // data members    
-    Int_t       fId;          ///< Identifier (unique)
-    AliMpArrayI fDEIds;       ///< Detection element Ids connected to this DDL
-    AliMpArrayI fBusPatchIds; ///< Bus patch Ids connected to this DDL
-    
+    Int_t       fId;            ///< Identifier (unique)
+    AliMpArrayI fDEIds;         ///< Detection element Ids connected to this DDL
+    AliMpArrayI fBusPatchIds;   ///< Bus patch Ids connected to this DDL
+    AliMpArrayI fTriggerCrateIds; ///< Trigger crate Ids connected to this DDL
+
      
   ClassDef(AliMpDDL,1)  // The class collectiong electronics properties of DDL
 };