19 #if !defined(__CINT__) || defined(__MAKECINT__)
21 #include <Riostream.h>
29 #include "TStopwatch.h"
47 for (UInt_t i = 0; i <
idxTree.size(); ++i) {
61 xEnergies[0] = (xCube[0] + i*
dim);
62 xEnergies[1] = (xCube[1] + j*
dim);
63 xEnergies[2] = (xCube[2] + k*
dim);
68 Int_t
IsInside(UShort_t* energies, Int_t mult, Short_t* inGate, Int_t* gateInf, Int_t* gateSup, Int_t multg)
72 for(Int_t i = 0; i < mult; ++i) {
75 Bool_t IsInGate =
false;
77 for(Int_t k = 0; k < multg; ++k) {
78 if( (energies[i] >= gateInf[k]) && (energies[i] <= gateSup[k]) ) {
93 Int_t
IsInside(Int_t* energies, Int_t mult, Short_t* inGate, UShort_t* gateInf, UShort_t* gateSup, Int_t multg)
96 Int_t usedGate[multg];
98 for(Int_t k = 0; k < multg; ++k)
101 for(Int_t i = 0; i < mult; ++i) {
104 Bool_t IsInGate =
false;
106 for(Int_t k = 0; k < multg; ++k) {
107 if( (energies[i] >= gateInf[k]) && (energies[i] <= gateSup[k]) ) {
108 if (usedGate[k] == 0) {
126 void ReadMiniTree3(Int_t gateInf1 = 195, Int_t gateSup1 = 205, Int_t gateInf2 = 292, Int_t gateSup2 = 300,
128 TString fileName =
"test8.root")
133 UShort_t e[
nTree][3];
135 UShort_t limInf[3] = {0, 0, 0};
136 UShort_t limSup[3] = {1023, 1023, 1023};
140 Int_t gateInf[2] = {gateInf1, gateInf2};
141 Int_t gateSup[2] = {gateSup1, gateSup2};
150 for (Int_t iTree = 0; iTree <
nTree; ++iTree) {
153 printf(
"%d %d %d %d\n", iTree, limInfr[0], limInfr[1], limInfr[2]);
154 printf(
"%d %d %d %d\n\n", iTree, limSupr[0], limSupr[1], limSupr[2]);
155 nofGates =
IsInside(gateInf, 2, inGate, limInfr, limSupr, 3);
156 if (inGate[0]*inGate[1] == 1) {
159 nofGates =
IsInside(gateSup, 2, inGate, limInfr, limSupr, 3);
161 if (inGate[0]*inGate[1] == 1) {
179 TFile* fileIn =
new TFile(fileName.Data(),
"READ");
180 for (Int_t i = 0; i <
nTree; ++i) {
181 oak[i] = (TTree*)fileIn->Get(Form(
"oak%d", i));
182 b[i] = oak[i]->GetBranch(
"e");
183 b[i]->SetAddress(&e[i]);
186 TH1F* h =
new TH1F(
"h",
"Projection", hDim, 0, hDim);
189 for (UInt_t iTree = 0; iTree <
idxTree.size(); ++iTree) {
192 Int_t nEntries = b[idx]->GetEntries();
193 printf(
"%d %d\n", idx, nEntries);
195 for (Int_t i = 0; i < nEntries; ++i) {
199 nofGates =
IsInside(er, 3, inGate, gateInf, gateSup, multg);
201 for (Int_t k= 0; k < 3; ++k) {
203 if (inGate[k] == 0) {
215 printf(
"Real time %6.3f\n", watch.RealTime());
printf("******************************************************************** \n")
void SetMiniCubeId(UShort_t *xCube, UShort_t *xEnergies, Int_t idx)
Int_t IsInside(UShort_t *energies, Int_t mult, Short_t *inGate, Int_t *gateInf, Int_t *gateSup, Int_t multg)
void ReadMiniTree3(Int_t gateInf1=195, Int_t gateSup1=205, Int_t gateInf2=292, Int_t gateSup2=300, TString fileName="test8.root")
std::vector< int > idxTree