BmnRoot
Loading...
Searching...
No Matches
CbmStsCluster.cxx
Go to the documentation of this file.
1//* $Id:
2
3// -------------------------------------------------------------------------
4// ----- CbmStsCluster source file -----
5// ----- Created 25/06/2008 by R. Karabowicz -----
6// -------------------------------------------------------------------------
7#include "CbmStsCluster.h"
8
9#include <iostream>
10
11using std::cout;
12using std::endl;
13
14
15// ----- Default constructor -------------------------------------------
17 : FairMultiLinkedData(),
18 fDetectorId(0),
19 fDigis(),
20 fNofDigis(0),
21 fChannel(0.),
22 fError(0.)
23{
24 // fDetectorId = 0;
25
26 // for now i limit the size to 99...
27 for ( Int_t itemp = 100 ; itemp > 0 ; ) fDigis[--itemp] = -1;
28 // fDigis = new Int_t[100];
29 /*
30 fNofDigis = 0;
31 fChannel = 0.;
32 fError = 0.;
33 */
34}
35// -------------------------------------------------------------------------
36
37// ----- Standard constructor ------------------------------------------
38CbmStsCluster::CbmStsCluster(Double_t digiSig, Int_t iStation, Int_t iSector, Int_t iSide)
39 : FairMultiLinkedData(),
40 fDetectorId(0),
41 fDigis(),
42 fNofDigis(0),
43 fChannel(0.),
44 fError(0.)
45{
46
47 // Check range for station, sector and side
48 if ( ! ( iStation >= 0 && iStation <= 255 ) ) {
49 cout << "-E- CbmStsCluster: Illegal station number " << iStation << endl;
50 Fatal("", "Illegal station number");
51 }
52 if ( ! ( iSector >= 0 && iSector <= 4095 ) ) {
53 cout << "-E- CbmStsCluster: Illegal sector number " << iSector << endl;
54 Fatal("", "Illegal sector number");
55 }
56 if ( ! ( iSide >= 0 && iSide <= 1 ) ) {
57 cout << "-E- CbmStsCluster: Illegal side number " << iSide << endl;
58 Fatal("", "Illegal side number");
59 }
60// AddIndex(index, digiSig);
61 // System id is set by the base class constructor on bits 0-4
62 fDetectorId = 2 << 24 ; // station nr. on bits 5-12
63 fDetectorId |= (iStation << 16); // station nr. on bits 5-12
64 fDetectorId |= (iSector << 4); // sector nr. on bits 13-27
65 fDetectorId |= (iSide << 0); // side on bit 28
66 // Channel number is set by the base class constructor
67
68 // fDigis = new Int_t[19];
69 for ( Int_t itemp = 100 ; itemp > 0 ; ) fDigis[--itemp] = -1;
70 // fDigis = new Int_t[100];
71 /*
72 fNofDigis = 0;
73 fChannel = 0.;
74 fError = 0.;
75 */
76}
77// -------------------------------------------------------------------------
78
79// ----- Destructor ----------------------------------------------------
81// -------------------------------------------------------------------------
virtual ~CbmStsCluster()