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