]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New class AliMpTriggerCrate, it contains:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:15:40 +0000 (11:15 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 11:15:40 +0000 (11:15 +0000)
- name
- DDL where the crate is connected
- the array of the associated local board Id
(Christian)

MUON/mapping/AliMpTriggerCrate.cxx [new file with mode: 0644]
MUON/mapping/AliMpTriggerCrate.h [new file with mode: 0644]

diff --git a/MUON/mapping/AliMpTriggerCrate.cxx b/MUON/mapping/AliMpTriggerCrate.cxx
new file mode 100644 (file)
index 0000000..30d86b3
--- /dev/null
@@ -0,0 +1,127 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+//
+// --------------------
+// Class AliMpTriggerCrate
+// --------------------
+// The class defines the properties of trigger crate
+// Author: Ch. Finck, Subatech Nantes
+
+#include "AliMpTriggerCrate.h"
+#include "AliMpDEManager.h"
+
+#include "AliLog.h"
+
+#include <Riostream.h>
+
+/// \cond CLASSIMP
+ClassImp(AliMpTriggerCrate)
+/// \endcond
+
+
+//______________________________________________________________________________
+TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDLs)
+{
+/// Generate name
+
+  TString name;
+  // \todo parameterise this
+  if (crateId == 23)
+      name = "2-3";
+  else 
+      name = Form("%d", crateId);
+  if (ddlId == nofDDLs)
+      name.Append("R");
+  else 
+      name.Append("L"); 
+
+  return name;
+}  
+
+//______________________________________________________________________________
+AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, Int_t ddlId)
+  : TNamed(name, "mapping trigger crate"),
+    fDdlId(ddlId),
+    fLocalBoard(false)
+{
+/// Standard constructor
+}
+
+//______________________________________________________________________________
+AliMpTriggerCrate::AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/)
+  : TNamed(),
+    fDdlId(),
+    fLocalBoard()
+{
+/// Root IO constructor
+}
+
+//______________________________________________________________________________
+AliMpTriggerCrate::~AliMpTriggerCrate()
+{
+/// Destructor
+}
+
+//
+// public methods
+//
+
+//______________________________________________________________________________
+Bool_t AliMpTriggerCrate::AddLocalBoard(Int_t localBoardId)
+{
+/// Add detection element with given detElemId.
+/// Return true if the detection element was added
+
+  if ( HasLocalBoard(localBoardId) ) {
+    AliWarningStream() 
+      << "Local board with Id=" << localBoardId << " already present."
+      << endl;
+    return false;
+  }    
+
+  fLocalBoard.Add(localBoardId);
+  return true;
+}   
+
+
+//______________________________________________________________________________
+Int_t AliMpTriggerCrate::GetNofLocalBoards() const
+{  
+/// Return the number of local board in this crate
+
+  return fLocalBoard.GetSize(); 
+}
+
+//______________________________________________________________________________
+Int_t  AliMpTriggerCrate::GetLocalBoardId(Int_t index) const
+{  
+/// Return the local board by index (in loop)
+
+  return fLocalBoard.GetValue(index); 
+}
+
+//______________________________________________________________________________
+Bool_t  AliMpTriggerCrate::HasLocalBoard(Int_t localBoardId) const
+{  
+/// Return true if crate has local boardwith given localBoardId
+
+  return fLocalBoard.HasValue(localBoardId); 
+}
+
diff --git a/MUON/mapping/AliMpTriggerCrate.h b/MUON/mapping/AliMpTriggerCrate.h
new file mode 100644 (file)
index 0000000..49ae9ee
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// $MpId: $ 
+
+/// \ingroup management
+/// \class AliMpTriggerCrate
+/// \brief The class defines the properties of trigger crate
+///
+/// \author Ch. Finck, Subatech Nantes
+
+#ifndef ALI_MP_TRIGGER_CRATE_H
+#define ALI_MP_TRIGGER_CRATE_H
+
+#include "AliMpArrayI.h"
+
+#include <TNamed.h>
+#include <TString.h>
+
+class AliMpTriggerCrate : public  TNamed {
+
+  public:
+    AliMpTriggerCrate(const Char_t* name, Int_t ddlId);
+    AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/);
+    virtual ~AliMpTriggerCrate();
+    
+    static TString GenerateName(Int_t crateId, Int_t ddlId, Int_t nodDdls);
+
+    // methods 
+    Bool_t AddLocalBoard(Int_t localBoardId);
+
+    // get methods
+    Int_t  GetDdlId() const;
+
+    Int_t  GetNofLocalBoards() const;
+    Int_t  GetLocalBoardId(Int_t index) const;
+    Bool_t HasLocalBoard(Int_t localBoardId) const;
+    
+
+  private:
+    /// Not implemented
+    AliMpTriggerCrate();
+    /// Not implemented
+    AliMpTriggerCrate(const AliMpTriggerCrate& rhs);
+    /// Not implemented
+    AliMpTriggerCrate& operator=(const AliMpTriggerCrate& rhs);
+
+    // data members    
+    Int_t        fDdlId; ///< DDL to which this bus patch is connected
+    AliMpArrayI  fLocalBoard; ///< local board connected to this crate
+    
+  ClassDef(AliMpTriggerCrate,1)  // The class collectiong electronics properties of DDL
+};
+
+// inline functions
+
+
+/// Return the Ddl  Id
+inline Int_t AliMpTriggerCrate::GetDdlId() const
+{  return fDdlId; }
+
+#endif //ALI_BUS_PATCH_H
+
+
+
+
+
+
+
+
+
+
+
+
+
+