HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoAnalysePrint.cxx
Go to the documentation of this file.
1 //
2 // File HarpoAnalysePrint.cxx
3 //
19 #include "HarpoAnalysePrint.h"
20 #include "HarpoConfig.h"
21 #include "HarpoDetSet.h"
22 //#include "HarpoDetSet.h"
23 #include "HarpoEvent.h"
24 
25 #include "TFile.h"
26 
27 #include <cstdlib>
28 #include <cstring>
29 #include <cassert>
30 #include <iostream>
31 
32 ClassImp(HarpoAnalysePrint)
33 
34 void HarpoAnalysePrint::print()
35  {
36  ULong_t nd; // number of detectors
37  HarpoEventHeader *hdr = fEvt->GetHeader();
38 
39  assert(hdr != NULL);
40  hdr->print();
41 
42  for (nd = 0; nd < gkNDetectors; nd++) {
43  // if (fEvt->isdataExist(nd)) {
44  HarpoDccMap *plane = fEvt->GetDccMap(nd);
45  if (plane != NULL )plane->print();
46  }
47  }
48 
50  {
51  nEvents++;
52  std::cout << " Processing Event " << nEvents<< std::endl;
53  //fEvt->print();
54  ULong_t ndet;
55  int i,j;
56  Long_t lEnum;
57 
58  lEnum = fEvt->GetHeader()->GetEvtNo();
59  hevtno->Fill(lEnum + 0.5);
60  for(ndet=0;ndet<gkNDetectors;ndet++) {
61  if (gHDetSet->isExist(ndet)) {
62  HarpoDccMap * m = fEvt->GetDccMap(ndet);
63  if ( m != NULL ) {
64  // for(j=0;j<NCHAN;j++) // Channels
65  for(j=0;j<NALL;j++) // Channels
66  for(i=0;i<NADC;i++) //Time bins
67  {
68  h10[ndet]->Fill(j+0.5,m->GetData(j,i));
69  h11[ndet]->Fill(i+0.5,m->GetData(j,i));
70  }
71 
72  } else {
73  std::cout << "No Data Map for plane "<< ndet << std::endl;
74  }
75  }
76  }
77 
78  }
79 
81  {
82  hevtno = new TH1F("hevtno","Event Number",300,0.0,3000.0);
83  h10[0] = new TProfile("h10_x","Plane X Dcc vs Chan",304,0.0,304.0,0.,4096.);
84  h10[1] = new TProfile("h10_y","Plane Y Dcc vs Chan",304,0.0,304.0,0.,4096.);
85  h11[0] = new TProfile("h11_x","Plane X Dcc vs Time",512,0.0,512.0,0.,4096.);
86  h11[1] = new TProfile("h11_y","Plane Y Dcc vs Time",512,0.0,512.0,0.,4096.);
87  }
88 
89 void HarpoAnalysePrint::Save(char * /* mode */)
90  {
91 
92  OpenHistFile("print");
93 
94  hevtno->Write();
95  h10[0]->Write();
96  h10[1]->Write();
97  h11[0]->Write();
98  h11[1]->Write();
99  }
100 
#define NALL
Definition: HarpoDccMap.h:15
void Save(char *mode=NULL)
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
Definition: HarpoDccMap.cxx:84
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Definition: HarpoDetSet.h:33
Long_t GetEvtNo()
Get Event Number.
virtual void print()
FullEvent Header not scecific to the detectors The class is ....
virtual void print()
TH1F * hevtno
Redefine empty default.
TFile * OpenHistFile(const char *ananame)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
Definition: HarpoDccMap.h:29
#define NADC
Definition: HarpoDccMap.h:18
HarpoEventHeader * GetHeader()
Definition: HarpoEvent.cxx:80
HarpoEvent * fEvt
Definition: HarpoAnalyse.h:70
Print raw data using HarpoAnalyse class.
ULong_t nEvents
Definition: HarpoAnalyse.h:75
const ULong_t gkNDetectors
Definition: HarpoDet.h:14
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
Definition: HarpoEvent.cxx:108
R__EXTERN HarpoDetSet * gHDetSet
Definition: HarpoDetSet.h:71