CMS 3D CMS Logo

TRawTower.cc

Go to the documentation of this file.
00001 //----------Author's Name:Jean Bourotte, F.X.Gentit
00002 //----------Copyright:Those valid for CMS sofware
00003 //----------Modified:10/4/2003
00004 #include <iostream>
00005 #include "IORawData/Ecal2004TBInputService/interface/TRawTower.h"
00006 
00007 using namespace std;
00008 
00009 ClassImp(TRawTower)
00010 
00011 //TClonesArray *TRawTower::fgCrystalsRaw[N_TOWERS];
00012 //______________________________________________________________________________
00013 //
00014 //  Tower of 25 crystals
00015 //
00016 Int_t TRawTower::fgNTowers = 68;
00017 
00018 TRawTower::TRawTower() {
00019 //Default constructor
00020   Init();
00021   //  printf("TRawTower constructor\n");
00022 }
00023 
00024 TRawTower::TRawTower(Int_t n,  Short_t rose_n,  Short_t rose_ch ) {
00025 //Constructor with data
00026   fNCrystal = 0;
00027   fN = n;
00028   fNRose   = rose_n;
00029   fNChRose = rose_ch; 
00030 }
00031 
00032 void TRawTower::FillCrystalData( Int_t icrys, Int_t h, Int_t *s ) {
00033   if (icrys < 0 ||  icrys > 24) {
00034     printf( "TRawTowers---> icrys is bad !!!!!!!!!!!!!! %d\n", icrys );
00035   } else {
00036     fCrystalsRaw[icrys].SetCrystalRaw( h, s );
00037     fNCrystal++;
00038   }
00039 }
00040 
00041 void TRawTower::Clear(const char *opt) {
00042 //Clear to go to next event
00043   fNCrystal = 0;
00044   //fCrystalsRaw->Clear("C");
00045 }
00046 
00047 void TRawTower::Init() {
00048 //Initialization
00049   Short_t j;
00050   fN = -1;
00051   fNCrystal = 0;
00052   fNRose    = 0;
00053   fNChRose  = 0;
00054   for (j=0;j<4;j++) fTowerHeader[j] = 0;
00055   for (j=0;j<5;j++) fStripHeader[j] = 0;
00056 }
00057 
00058 void TRawTower::SetHeaders( Int_t *th, Int_t *sh ){
00059   Short_t j;
00060   for (j=0;j<4;j++) fTowerHeader[j] = th[j];
00061   for (j=0;j<5;j++) fStripHeader[j] = sh[j];
00062 }
00063 
00064 void TRawTower::SetRoseInfo( Short_t rose_n,  Short_t rose_ch ){
00065   fNRose   = rose_n;
00066   fNChRose = rose_ch; 
00067 }
00068 
00069 void TRawTower::Print(const char *opt) const {
00070 //Prints everything
00071   Int_t j;
00072   cout << endl;
00073   cout << "Tower Number   : " << fN << endl;
00074   cout << "Nb of crystals : " << fNCrystal << endl;
00075   cout << "Rose Number    : " << fNRose << endl;
00076   cout << "Rose Channel   : " << fNChRose << endl;
00077   cout << "Tower Header words:" << endl;
00078   for (j=0;j<4;j++) {
00079     cout << "   " << fTowerHeader[j];
00080   }
00081   cout << endl;
00082   cout << "Strip Header words:" << endl;
00083   for (j=0;j<5;j++) {
00084     cout << "   " << fStripHeader[j];
00085   }
00086   cout << endl;
00087   //for (j=0;j<fNCrystal;j++) (*fCrystalsRaw)[j]->Print();
00088   //call only TObect print method
00089   for (j=0;j<fNCrystal;j++){
00090     fCrystalsRaw[j].Print();
00091   }
00092   cout << endl;
00093 }

Generated on Tue Jun 9 17:39:24 2009 for CMSSW by  doxygen 1.5.4