73 {
74 MsgStream log(
msgSvc(), name());
75 log << MSG::INFO << "in initialize()" << endmsg;
76
77 if(RunModel==1){
78 CrossSection=jpsiCrossSection;
79 MCEff=jpsiMCEff;
80 MCEffBoost=jpsiMCEffBoost;
81 boostPhimin=2.5;
82 boostPhimax=5;
83 boostMinEmin=1.2;
84 boostMinEmax=1.6;
85 }
86 else if(RunModel==2){
87 CrossSection=psi2sCrossSection;
88 MCEff=psi2sMCEff;
89 MCEffBoost=psi2sMCEffBoost;
90 boostPhimin=2.5;
91 boostPhimax=5;
92 boostMinEmin=1.4;
93 boostMinEmax=1.9;
94 }
95 else if(RunModel==3){
96 CrossSection=psi3770CrossSection;
97 MCEff=psi3770MCEff;
98 MCEffBoost=psi3770MCEffBoost;
99 boostPhimin=2.5;
100 boostPhimax=5;
101 boostMinEmin=1.4;
102 boostMinEmax=2;
103 }
104
105 tot=0;
106 signal=0;
107 boost_signal=0;
108 boost_tot=0;
109 StatusCode ssc=service("THistSvc", m_thsvc);
110 if(ssc.isFailure()) {
111 log << MSG::FATAL << "DiGamAlg:Couldn't get THistSvc" << endreq;
112 return ssc;
113 }
114 h_lum=new TH1F("lum","lum",4,0.5,4.5);
115
116 StatusCode scBeamEnergy=service("BeamEnergySvc", m_BeamEnergySvc);
117
118 if( scBeamEnergy.isFailure() ){
119 log << MSG::FATAL << "can not use BeamEnergySvc" << endreq;
120 return scBeamEnergy;
121 }
122
123 StatusCode status;
124
125 NTuplePtr nt2(
ntupleSvc(),
"DQAFILE/zhsDiGam");
126 if(nt2)m_tuple2=nt2;
127 else{
128 m_tuple2=
ntupleSvc()->book(
"DQAFILE/zhsDiGam",CLID_ColumnWiseTuple,
"ks N-Tuple example");
129 if(m_tuple2){
130 status=m_tuple2->addItem("ETol",m_tot);
131 status=m_tuple2->addItem("maxE",m_maxE);
132 status=m_tuple2->addItem("minE",m_minE);
133 status=m_tuple2->addItem("maxTheta",m_maxTheta);
134 status=m_tuple2->addItem("minTheta",m_minTheta);
135 status=m_tuple2->addItem("maxPhi",m_maxPhi);
136 status=m_tuple2->addItem("minPhi",m_minPhi);
137 status=m_tuple2->addItem("delTheta",m_delTheta);
138 status=m_tuple2->addItem("delPhi",m_delPhi);
139 status=m_tuple2->addItem("angle",m_angle);
140 status=m_tuple2->addItem("boostAngle",m_boostAngle);
141 status=m_tuple2->addItem("boostMaxE",m_boostMaxE);
142 status=m_tuple2->addItem("boostMinE",m_boostMinE);
143 status=m_tuple2->addItem("boostDelPhi",m_boostDelPhi);
144 status=m_tuple2->addItem("boostDelTheta",m_boostDelTheta);
145 status=m_tuple2->addItem("boostM",m_boostM);
146 status=m_tuple2->addItem("boostIM",m_boostIM);
147 status=m_tuple2->addItem("m",m_m);
148 status=m_tuple2->addItem("IM",m_IM);
149
150 status=m_tuple2->addItem ("run",m_run );
151 status=m_tuple2->addItem ("rec",m_rec );
152 status=m_tuple2->addItem("indexmc", m_idxmc, 0, 100);
153 status=m_tuple2->addIndexedItem("pdgid", m_idxmc, m_pdgid);
154 status=m_tuple2->addIndexedItem("motheridx", m_idxmc, m_motheridx);
155
156 }
157 else {
158 log<<MSG::FATAL<<"Cannot book N-tuple:"<<long(m_tuple2)<<endmsg;
159 return StatusCode::FAILURE;
160 }
161 }
162
163 return StatusCode::SUCCESS;
164}