/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/root/MTChannel.cpp

Go to the documentation of this file.
00001 /* @version $Revision: 1759 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-06-04 16:49:12 +0200 (Mon, 04 Jun 2012) $ */
00002 #include "TDirectory.h"
00003 #include "TProcessID.h"
00004 
00005 
00006 #include "root/MTChannel.hh"
00007 #include "root/MTEvent.hh"
00008 
00009 #include "event/Event.hh"
00010 #include "event/ChannelHit.hh"
00011 #include "event/Run.hh"
00012 #include "geometry/Chamber.hh"
00013 #include "geometry/Chip.hh"
00014 #include "geometry/Board.hh"
00015 #include "geometry/Dif.hh"
00016 #include "geometry/Detector.hh"
00017 #include "tools/MicroException.hh"
00018 #include "tools/Log.hh"
00019 
00020 
00021 #include <iostream>
00022 #include <sstream>
00023 
00024 class MTEvent; 
00025 
00026 using namespace std;
00027 
00028 ClassImp(MTChannel);
00029 //------------------------------------------
00030 
00031 Int_t MTChannel::Compare(const TObject *obj) const
00032 {
00033  if (bcId_Hit == ((MTChannel *)obj)->GetBcId_Hit()) return 0;
00034  else if (bcId_Hit < ((MTChannel *)obj)->GetBcId_Hit()) return -1;
00035  else return 1;
00036 }
00037 
00038 /*------------------------------------------------------------------------------
00039  *
00040  *    MTChannel implementation
00041  *
00042  *-----------------------------------------------------------------------------*/
00043 
00044 //______________________________________________________________________________
00045 MTChannel::MTChannel() 
00046 {
00047    // Copy a channel object
00048 
00049   fAnalogValue   =  0;
00050   fDigitalValue  =  0;
00051   fEnergy   =  0.;
00052   fHardId  = 0;
00053   fX       = 0.;
00054   fY       = 0.;
00055   fZ       = 0.;
00056   rowInChamber = 0;
00057   colInChamber = 0;
00058   fOrder   = 0;
00059   timestamp = 0;
00060   bcId_Abs =  0;
00061   bcId_Dif = 0; 
00062   bcId_Hit = 0; 
00063   bcId_Hit_Fine = 0; 
00064   memoryOrder = 0; 
00065   rejected = false;
00066 }
00067 //______________________________________________________________________________
00068 MTChannel::MTChannel(const MTChannel &orig)// : TObject(orig)
00069 {
00070    // Copy a channel object
00071 
00072   fAnalogValue   = orig.fAnalogValue;
00073   fDigitalValue  = orig.fDigitalValue;
00074   fEnergy   = orig.fEnergy;
00075   fSoftId  = orig.fSoftId;
00076   fHardId  = orig.fHardId;
00077   fX       = orig.fX;
00078   fY       = orig.fY;
00079   fZ       = orig.fZ;
00080   rowInChamber = orig.rowInChamber;
00081   colInChamber = orig.colInChamber;
00082   fOrder   = orig.fOrder;
00083   timestamp = orig.timestamp;
00084   bcId_Abs = orig.bcId_Abs;
00085   bcId_Dif = orig.bcId_Dif;
00086   bcId_Hit = orig.bcId_Hit;
00087   bcId_Hit_Fine = orig.bcId_Hit_Fine;
00088   memoryOrder = orig.memoryOrder;
00089 ;
00090 
00091   rejected = orig.rejected;
00092 }
00093 
00094 
00095 //______________________________________________________________________________
00096 MTChannel::MTChannel(const ChannelHit& hit, UInt_t order) {
00097   const Channel& ch = hit.getChannel();
00098 
00099   fAnalogValue   = hit.getAnalogValue();
00100   fEnergy   = 0;
00101   fDigitalValue  = hit.getDigitalValue();
00102         const Chip&  chip = ch.getChip() ;
00103         const Board& board = chip.getBoard() ;
00104         const Dif* dif = board.getDif();
00105         unsigned int difId = 0;
00106         if ( dif != NULL) difId = dif->getId();
00107         const Chamber& cham = ch.getChamber();
00108 
00109         fSoftId.SetValue(cham.getId(), difId, board.getId(), board.getRow(), board.getColumn(), board.getNbRows(), board.getNbColumns(), 
00110                   chip.getId(),chip.getRow(), chip.getColumn(),chip.getNbRows(), chip.getNbColumns(),  chip.getSerialNumber(),
00111                   ch.getHardId(),ch.getRow(),ch.getColumn());
00112         fHardId =ch.getHardId() ;
00113 
00114 
00115   fHardId = ch.getHardId();
00116   fX = ch.getX(); fY = ch.getY(); fZ = ch.getZ();
00117   rowInChamber = ch.getRowInChamber(); 
00118   colInChamber = ch.getColInChamber();
00119   fOrder = order;
00120   timestamp = hit.getTimestamp();
00121   bcId_Abs = hit.getBcId_Abs();
00122   bcId_Dif = hit.getBcId_Dif();
00123   bcId_Hit = hit.getBcId_Hit();
00124   bcId_Hit_Fine = hit.getBcId_Hit_Fine();
00125   memoryOrder = hit.getMemoryOrder();
00126 
00127 
00128   rejected = 0;
00129 
00130 
00131 }
00132 
00133 //______________________________________________________________________________
00134 UInt_t MTChannel::GetChamberId(void) const
00135 {
00136                 return fSoftId.GetChamberId();
00137 }
00138 //______________________________________________________________________________
00139 UInt_t MTChannel::GetBoardId(void) const
00140 {
00141                 return fSoftId.GetBoardId();
00142 }
00143 //______________________________________________________________________________
00144 UInt_t MTChannel::GetDifId(void) const
00145 {
00146                 return fSoftId.GetDifId();
00147 }
00148 //______________________________________________________________________________
00149 UInt_t MTChannel::GetChipId(void) const
00150 {
00151                 return fSoftId.GetChipId();
00152 }
00153 //______________________________________________________________________________
00154 UInt_t MTChannel::GetRowInChip(void) const
00155 {
00156                 return fSoftId.GetRowInChip();
00157 }
00158 //______________________________________________________________________________
00159 UInt_t MTChannel::GetColInChip(void) const
00160 {
00161                 return fSoftId.GetColInChip();
00162 }
00163 //______________________________________________________________________________

Generated on Mon Jun 11 16:55:46 2012 for MicromegasFramework by  doxygen 1.4.7