HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoAnalyseMultiplicityAget.cxx
Go to the documentation of this file.
1 //
2 // File HarpoAnalyseMultiplicityAget.cxx
3 //
12 #include "HarpoConfig.h"
13 #include "HarpoDetSet.h"
14 #include "HarpoDebug.h"
15 #include "HarpoDccEvent.h"
16 #include "Pmm2Event.h"
17 #include "HarpoEvent.h"
18 #include "HarpoRecoEvent.h"
19 #include "HarpoSimEvent.h"
20 
21 #include "TFile.h"
22 #include "TStyle.h"
23 #include "TCanvas.h"
24 #include "TLatex.h"
25 #include "TGraph.h"
26 #include "TF1.h"
27 #include "TMath.h"
28 #include "TRandom3.h"
29 #include "TSystem.h"
30 
31 #include <cstdlib>
32 #include <cstring>
33 #include <cassert>
34 #include <fstream>
35 #include <iostream>
36 
38 
40  {
41  unsigned int nd; // number of detectors
43 
44  assert(hdr != NULL);
45  hdr->print();
46 
47  for (nd = 0; nd < gkNDetectors; nd++) {
48  // if (fEvt->isdataExist(nd)) {
49  HarpoDccMap *plane = fEvt->GetDccMap(nd);
50  if (plane != NULL )plane->print();
51  }
52  }
53 
55 {
56  // Bool_t drawEvent = kFALSE;
57  nEvents++;
58 
59  // Process RAW data
60  for(Int_t ndet=0;ndet<2;ndet++) { // Detectors 0 and 1 = X and Y planes
61  if (!gHDetSet->isExist(ndet)) continue;
62  HarpoDccMap* m = fEvt->GetDccMap(ndet);
63  if ( m == NULL ) continue;
64 
65  for(Int_t i=0;i<NADC;i++){
66  Int_t chipold = -1, mult = 0;
67  for(Int_t j=0;j<NCHAN;j++){ // Channels
68  Int_t chip = Int_t(j/64) + ndet*fNchips;
69  if(chip>=fNchips) break;
70  if(chip > chipold){
71  //AGET[chip][j] = mult;
72  mult = 0;
73  Double_t noise = gRandom->Gaus(0);
74  fNtuple->Fill(nEvents,chip,j, mult, noise);
75  }
76  chipold = chip;
77  // Double_t qch = 0;
78  Double_t q = m->GetData(j,i);
79  if(q <= fThr) continue;
80  mult++;
81  }
82  }
83  }
84 
85 }
86 
88 {
89 
90  fThr = 100;
91  fNchips = 4;
92 
93  fNtuple = new TNtupleD("fNtuple","AGET signal","evt:chip:t:mult");
94 
95  }
96 
97 void HarpoAnalyseMultiplicityAget::Save(char * /* mode */)
98  {
99 
100 
101  /* TFile* hf = */ OpenHistFile("multiplicity");
102 
103  // Save histograms here
104  fNtuple->Write();
105 
106  }
107 
#define NCHAN
Definition: HarpoDccMap.h:16
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
Definition: HarpoDccMap.cxx:84
Dummy analysis to run as test and example. Give basic histograms of the data.
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Definition: HarpoDetSet.h:33
void print()
Overloaded method which do all job.
virtual void print()
FullEvent Header not scecific to the detectors The class is ....
virtual void print()
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
ULong_t nEvents
Definition: HarpoAnalyse.h:75
Int_t fNchips
Redefine empty default.
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