1#include "GaudiKernel/IInterface.h"
2#include "GaudiKernel/StatusCode.h"
3#include "GaudiKernel/SvcFactory.h"
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/SmartDataPtr.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
9#include "GaudiKernel/SmartIF.h"
10#include "GaudiKernel/IAppMgrUI.h"
11#include "GaudiKernel/IProperty.h"
14#include "GaudiKernel/IIncidentSvc.h"
15#include "GaudiKernel/Incident.h"
16#include "GaudiKernel/IIncidentListener.h"
17#include "GaudiKernel/ISvcLocator.h"
18#include "GaudiKernel/Bootstrap.h"
37 int NumCriteria = m_criteria.size();
39 std::cout<<
"the number of criterias too much!!"<<std::endl;
40 return StatusCode::SUCCESS;
42 if(m_criteria[0].find(
"<NumOfGoodCh<") == std::string::npos){
43 std::cout<<
"pls ensure your first criterias is NumOfCharged"<<std::endl;
44 return StatusCode::SUCCESS;
47 vector<string> criteria;
48 map<string, int> Cut1;
49 map<string, int> Cut2;
50 for(
int i=0;i<NumCriteria;i++){
51 int nPos_1 = m_criteria[i].find_first_of(
"<");
52 int nPos_2 = m_criteria[i].find_last_of(
"<");
53 if(nPos_1 == nPos_2 || nPos_1==-1 || nPos_2==-1) {
54 std::cout<<
"pls check your criterias"<<std::endl;
55 return StatusCode::SUCCESS;
57 string name_cut = m_criteria[i].substr(nPos_1+1,nPos_2-nPos_1-1);
58 Cut1[name_cut] = atoi(m_criteria[i].substr(0).c_str());
59 Cut2[name_cut] = atoi(m_criteria[i].substr(nPos_2+1).c_str());
60 criteria.push_back(name_cut);
61 std::cout<<
"criteria is "<<criteria[i]<<std::endl;
62 std::cout<<
"nCTrkCut1: "<<Cut1[criteria[i]]<<
" nCTrkCut2: "<<Cut2[criteria[i]]<<std::endl;
76 std::vector<int> ventry_temp;
78 TFile*
file = TFile::Open( m_fileName.c_str() );
79 TTree* t0 = (TTree*)
file->Get(
"Metadata");
80 Int_t mode, begin, end;
81 t0->SetBranchAddress(
"mode", &mode);
82 t0->SetBranchAddress(
"begin", &begin);
83 t0->SetBranchAddress(
"end", &end);
85 for (
int i = 0; i < t0->GetEntries(); ++i ) {
87 std::cout<<
"t0 entry: "<<i<<std::endl;
88 if ( (mode != -1) && (mode>Cut1[
"NumOfGoodCh"] && mode<Cut2[
"NumOfGoodCh"]) ) {
89 for (
int i = begin; i < end; ++i ) {
90 ventry_temp.push_back(i);
101 TTree* t3 = (TTree*)
file->Get(
"Entries");
102 UInt_t tagData0, tagData1, tagData2, tagData3, tagData4;
103 t3->SetBranchAddress(
"tagData0", &tagData0);
104 t3->SetBranchAddress(
"tagData1", &tagData1);
105 t3->SetBranchAddress(
"tagData2", &tagData2);
106 t3->SetBranchAddress(
"tagData3", &tagData3);
107 t3->SetBranchAddress(
"tagData4", &tagData4);
109 Int_t npip, npim, nkp, nkm, nlambda, nalambda;
110 Int_t npp, npm, nep, nem, nmup, nmum, neta, npi0, ngamma, nks;
111 Int_t nCharged, nGoodChargedp, nGoodChargedm,totCharged,nNeutrk, nTottrk;
112 for (
int i=0;i<ventry_temp.size();i++ )
114 t3->GetEntry(ventry_temp[i]);
115 Tag1ToInt(tagData1, nNeutrk, nTottrk, ngamma, npi0);
116 Tag2ToInt(tagData2, npip, npim, nkp, nkm, npp, npm);
117 Tag2ToInt(tagData3, nlambda, nalambda, nep, nem, nmup, nmum);
118 Tag2ToInt(tagData4, nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
124 if( Cut2[
"NumOfNeutrk"]!=0&& (nNeutrk>=Cut2[
"NumOfNeutrk"] || nNeutrk<=Cut1[
"NumOfNeutrk"] ))
continue;
125 if( Cut2[
"NumOfTottrk"]!=0&& (nTottrk>=Cut2[
"NumOfTottrk"] || nTottrk<=Cut1[
"NumOfTottrk"] ))
continue;
126 if( Cut2[
"NumOfGamma"]!=0 && (ngamma>=Cut2[
"NumOfGamma"] || ngamma<=Cut1[
"NumOfGamma"] ))
continue;
127 if( Cut2[
"NumOfPion0"]!=0 && (npi0>=Cut2[
"NumOfPion0"] || npi0<=Cut1[
"NumOfPion0"] ))
continue;
128 if( Cut2[
"NumOfPionp"]!=0 && (npip>=Cut2[
"NumOfPionp"] || npip<=Cut1[
"NumOfPionp"] ))
continue;
129 if( Cut2[
"NumOfPionm"]!=0 && (npim>=Cut2[
"NumOfPionm"] || npim<=Cut1[
"NumOfPionm"] ))
continue;
130 if( Cut2[
"NumOfKaonp"]!=0 && (nkp>=Cut2[
"NumOfKaonp"] || nkp<=Cut1[
"NumOfKaonp"] ))
continue;
131 if( Cut2[
"NumOfKaonm"]!=0 && (nkm>=Cut2[
"NumOfKaonm"] || nkm<=Cut1[
"NumOfKaonm"] ))
continue;
132 if( Cut2[
"NumOfProtonp"]!=0 && (npp>=Cut2[
"NumOfProtonp"] || npp<=Cut1[
"NumOfProtonp"] ))
continue;
133 if( Cut2[
"NumOfProtonm"]!=0 && (npm>=Cut2[
"NumOfProtonm"] || npp<=Cut1[
"NumOfProtonm"] ))
continue;
134 if( Cut2[
"NumOfLambda"]!=0 && (nlambda>=Cut2[
"NumOfLambda"] || nlambda<=Cut1[
"NumOfLambda"] ))
continue;
135 if( Cut2[
"NumOfALambda"]!=0 && (nalambda>=Cut2[
"NumOfALambda"] || nalambda<=Cut1[
"NumOfALambda"] ))
continue;
136 if( Cut2[
"NumOfElectronp"]!=0 && (nep>=Cut2[
"NumOfElectronp"] || nep<=Cut1[
"NumOfElectronp"] ))
continue;
137 if( Cut2[
"NumOfElectronm"]!=0 && (nem>=Cut2[
"NumOfElectronm"] || nem<=Cut1[
"NumOfElectronm"] ))
continue;
138 if( Cut2[
"NumOfMuonp"]!=0 && (nmup>=Cut2[
"NumOfMuonp"] || nmup<=Cut1[
"NumOfMuonp"] ))
continue;
139 if( Cut2[
"NumOfMuonm"]!=0 && (nmum>=Cut2[
"NumOfMuonm"] || nmum<=Cut1[
"NumOfMuonm"] ))
continue;
140 if( Cut2[
"NumOfKs"]!=0 && (nks>=Cut2[
"NumOfKs"] || nks<=Cut1[
"NumOfKs"] ))
continue;
141 if( Cut2[
"NumOfEta"]!=0 && (neta>=Cut2[
"NumOfEta"] || neta<=Cut1[
"NumOfEta"] ))
continue;
142 if( Cut2[
"NumOfCharged"]!=0 && (nCharged>=Cut2[
"NumOfCharged"] || nCharged<=Cut1[
"NumOfCharged"] ))
continue;
143 if( Cut2[
"NumOfGoodChp"]!=0 && (nGoodChargedp>=Cut2[
"NumOfGoodChp"] || nGoodChargedp<=Cut1[
"NumOfGoodChp"] ))
continue;
144 if( Cut2[
"NumOfGoodChm"]!=0 && (nGoodChargedm>=Cut2[
"NumOfGoodChm"] || nGoodChargedm<=Cut1[
"NumOfGoodChm"] ))
continue;
145 if( Cut2[
"TotCharged"]!=0 && (totCharged>=Cut2[
"TotCharged"] || totCharged<=Cut1[
"TotCharged"] ))
continue;
146 ventry.push_back(ventry_temp[i]);
152 return StatusCode::SUCCESS;
156 val1 = (res>>24) & 0xFF;
157 val2 = (res>>16) & 0xFF;
158 val3 = (res>>8) & 0xFF;
164 val1=(res>>26) & 0x3F;
165 val2=(res>>20) & 0x3F;
166 val3=(res>>15) & 0x1F;
167 val4=(res>>10) & 0x1F;
168 val5=(res>>5) & 0x1F;
void Tag2ToInt(unsigned int res, int &val1, int &val2, int &val3, int &val4, int &val5, int &val6)
void Tag1ToInt(unsigned int res, int &val1, int &val2, int &val3, int &val4)
StatusCode getVEntry(vector< int > &)