HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoSelectCosmics.cxx
Go to the documentation of this file.
1 //
2 // File HarpoSelectCosmics.cxx
3 //
11 #include "HarpoSelectCosmics.h"
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 "TSystem.h"
29 
30 #include <cstdlib>
31 #include <cstring>
32 #include <cassert>
33 #include <fstream>
34 #include <iostream>
35 
36 ClassImp(HarpoSelectCosmics);
37 
39  {
40  unsigned int nd; // number of detectors
42 
43  assert(hdr != NULL);
44  hdr->print();
45 
46  for (nd = 0; nd < gkNDetectors; nd++) {
47  // if (fEvt->isdataExist(nd)) {
48  HarpoDccMap *plane = fEvt->GetDccMap(nd);
49  if (plane != NULL )plane->print();
50  }
51  }
52 
54 {
55  // Bool_t drawEvent = kFALSE;
56  nEvents++;
57  if(nEvents%1000 == 0) Info("process","Check Event %ld",nEvents);
58 
60 
61  if(gHDetSet->isExist(PMM2)) { // PMm2 (trigger) data
62  Pmm2Event *anaEvt = static_cast<Pmm2Event *>(fEvt->GetDetEvent(PMM2));
63  Int_t triggerType = anaEvt->GetTriggerType(); // Trigger line (with mesh, without, traversing tracks, ...)
64  hTriggerType->Fill(triggerType);
65  if(fTriggerType>=0 && triggerType == fTriggerType){
67  hTriggerTypeCut->Fill(triggerType);
68  return;
69  }
70  int imes;
71  int esize = anaEvt->GetHeader()->eventSize; // number of PMs hit
72  Pmm2MesVect * pm = anaEvt->GetMesurements(); // data for each included PM
73  int hit[16];
74  for(int ch = 0; ch<16; ch++) hit[ch] = 0;
75  for(imes=0;imes<esize;imes++) {
76  int ch = pm->at(imes).getChNum(); // channel
77  // int q = pm->at(imes).getCharge(); // charge
78  hit[ch] = 1;
79  }
80 
81  if(fTriggerType == -1 && hit[3] && hit[4] && hit[5] && hit[6]){
83  hTriggerTypeCut->Fill(triggerType);
84  return;
85  }
86  //if(fTriggerType == -2 && !(hit[3] && hit[4]) && !(hit[5] && hit[6])){
87  if(fTriggerType == -2 && hit[1] && hit[2] && hit[7] && hit[8]){
89  hTriggerTypeCut->Fill(triggerType);
90  return;
91  }
92 
93 
94  }
95 
96 }
97 
99 {
100 
101  // Initialise histograms here
102  Int_t fTriggerType = -1;
103  Long64_t triggerType;
104  if( ! gHConfig->Lookup("SelectorCosmics.triggerType",triggerType ))
105  Info("Constructor","Use default trigger type %d",fTriggerType);
106  else
107  fTriggerType = triggerType;
108 
109 
110  hTriggerType = new TH1F("hTriggerType",";trigger channel",20,-2,18);
111  hTriggerTypeCut = new TH1F("hTriggerType",";trigger channel",20,-2,18);
112 
113  }
114 
115 void HarpoSelectCosmics::Save(char * /* mode */)
116  {
117 
118 
119  OpenHistFile("selectcosmics");
120 
121  // Save histograms here
122  hTriggerType->Write();
123  hTriggerTypeCut->Write();
124 
125  }
126 
Dcc Plane Y.
Definition: HarpoDet.h:20
void print()
Overloaded method which do all job.
void Save(char *mode=NULL)
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Definition: HarpoDetSet.h:33
void SetEvAnaStatus(Int_t status)
Set Event Analise status.
UInt_t eventSize
Raw Event size.
Definition: HarpoDetEvent.h:28
virtual void print()
FullEvent Header not scecific to the detectors The class is ....
Int_t GetTriggerType()
Definition: Pmm2Event.h:29
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
HarpoDetEvent * GetDetEvent(Long_t plane=XDCC)
Definition: HarpoEvent.cxx:93
Dummy analysis to run as test and example. Give basic histograms of the data.
Pmm2MesVect * GetMesurements()
Return pointer to decoded data.
Definition: Pmm2Event.cxx:78
Bool_t Lookup(const char *path, Bool_t &val)
Lookup function for scalar values.
A class store HARPO raw PMM2 event buffer and header. End provide access metods to the row data...
Definition: Pmm2Event.h:19
virtual const EventHeader_t * GetHeader() const
Definition: HarpoDetEvent.h:38
HarpoEventHeader * GetHeader()
Definition: HarpoEvent.cxx:80
HarpoEvent * fEvt
Definition: HarpoAnalyse.h:70
ULong_t nEvents
Definition: HarpoAnalyse.h:75
Int_t getChNum() const
Definition: Pmm2Mes.h:28
Int_t fTriggerType
Redefine empty default.
const ULong_t gkNDetectors
Definition: HarpoDet.h:14
HarpoConfig * gHConfig
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
Definition: HarpoEvent.cxx:108
A list of all mesurements in one Event for Pmm2 v2 card The class is place holder for all unpacked me...
Definition: Pmm2MesList.h:19
Pmm2Mes at(ULong_t idx)
Definition: Pmm2MesList.h:37
R__EXTERN HarpoDetSet * gHDetSet
Definition: HarpoDetSet.h:71