#include <ANtpInfoObjectFillerMRCC.h>
Public Member Functions | |
| void | FillEventInformation (int i, const NtpMRRecord *mrRecord, const NtpStRecord *stRecord, ANtpEventInfoMRCC *antp, ANtpTruthInfoBeam *truth) const |
| Fill antp mrcc information corresponding to i using best_event. | |
Protected Member Functions | |
| void | FillEventInformationHelper (const NtpMREvent *mrnt, const NtpStRecord *sntp_orig, ANtpEventInfoMRCC *antp, ANtpTruthInfoBeam *truth) const |
| Internal helper, copy contents of mrnt into antp. | |
| double | ABPID (const NtpSREvent *ev, const NtpStRecord *st) const |
| double | ROPID (const NtpSREvent *ev, const NtpStRecord *st) const |
|
||||||||||||
|
Return the AB PID value for event ev in snarl st, reading the appropriate PDFs if necessary Definition at line 147 of file ANtpInfoObjectFillerMRCC.cxx. References ReleaseType::AsString(), base, MadAbID::CalcPID(), det, VldContext::GetDetector(), NtpStRecord::GetRelease(), RecRecordImp< T >::GetVldContext(), gSystem(), ReleaseType::IsCedar(), MSG, and MadAbID::ReadPDFs(). Referenced by FillEventInformationHelper(). 00148 {
00149 static bool once=false;
00150 static MadAbID ABID;
00151
00152 // Code stolen from NueAna's MuonRemovalInfoAna
00153 if(!once){
00154 once=true;
00155 string base=getenv("SRT_PRIVATE_CONTEXT");
00156 if(base!="" && base!="."){
00157 // check if directory exists in SRT_PRIVATE_CONTEXT
00158 string path = base + "/Mad/data";
00159 void* dir_ptr = gSystem->OpenDirectory(path.c_str());
00160 if(!dir_ptr){
00161 base=getenv("SRT_PUBLIC_CONTEXT");
00162 }
00163 }
00164 else{
00165 base=getenv("SRT_PUBLIC_CONTEXT");
00166 }
00167 if(base=="") {
00168 MSG("ObjectFillerMRCC",Msg::kFatal)<<"No SRT_PUBLIC_CONTEXT set "
00169 <<"Do not know where to look "
00170 <<"for AB pdf files "<<std::endl;
00171 // Dummy message to make sure it exits
00172 MSG("ObjectFillerMRCC",Msg::kFatal) << "Goodbye" << endl;
00173 }
00174 base+="/Mad/data";
00175 string fname=base;
00176 string rmc="";
00177 // ARGH! Can't do this at all sensibly, since there aren't PDF
00178 // files for dogwood (I guess). Should also really check on MC
00179 // version, but this code is never going to be run on anything
00180 // other than daikon, so it doesn't matter.
00181 ReleaseType::Release_t release=st->GetRelease();
00182 if(ReleaseType::IsCedar(release)){
00183 rmc="cedar_daikon";
00184 }
00185 else{
00186 MSG("ObjectFillerMRCC",Msg::kWarning)
00187 << "Running on release type " << ReleaseType::AsString(release)
00188 << " which has no PDFs. Using cedar_daikon instead." << endl;
00189 rmc="cedar_daikon";
00190 }
00191
00192 string sdet="";
00193 Detector::Detector_t det=st->GetVldContext()->GetDetector();
00194 if(det==Detector::kNear){
00195 sdet="near";
00196 }
00197 else if(det==Detector::kFar){
00198 sdet="far";
00199 }
00200 else{
00201 MSG("ObjectFillerMRCC",Msg::kFatal) << "Dont know detector type."
00202 << " Bailing"<<endl;
00203 // Dummy message to make sure it exits
00204 MSG("ObjectFillerMRCC",Msg::kFatal) << "Goodbye" << endl;
00205 }
00206 string sbeam="le";
00207 /*
00208 Should really do this switch, but I don't know how to get the
00209 beamtype through to here to check against. Probably won't ever
00210 run it on non-LE events anyway.
00211
00212 switch(current_beam){
00213 case BeamType::kL010z000i:
00214 sbeam="le0";
00215 break;
00216 case BeamType::kL010z170i:
00217 sbeam="le170";
00218 break;
00219 case BeamType::kL010z185i:
00220 sbeam="le";
00221 break;
00222 case BeamType::kL010z200i:
00223 sbeam="le200";
00224 break;
00225 case BeamType::kL100z200i:
00226 sbeam="pme";
00227 break;
00228 case BeamType::kL150z200i:
00229 sbeam="pme";
00230 break;
00231 case BeamType::kL250z200i:
00232 sbeam="phe";
00233 break;
00234 case BeamType::kLE:
00235 sbeam="le";
00236 break;
00237 default:
00238 MSG("ObjectFillerMRCC",Msg::kWarning)<<"Don't know beam type "
00239 <<" defaulting to LE"<<endl;
00240 sbeam="le";
00241 break;
00242 }
00243 */
00244
00245 fname+="/ab_pdf_"+sdet+"_"+sbeam+"_"+rmc+".root";
00246
00247 ABID.ReadPDFs(fname.c_str());
00248 }
00249
00250 return ABID.CalcPID(ev, st);
00251 }
|
|
||||||||||||||||||||||||
|
Fill antp mrcc information corresponding to i using best_event.
Definition at line 30 of file ANtpInfoObjectFillerMRCC.cxx. References NtpMREvent::best_event, FillEventInformationHelper(), and NtpMRRecord::mrevt. Referenced by CondensedNtpModuleNC::Ana(). 00035 {
00036 assert(i >= 0);
00037 assert(mrRecord);
00038
00039 // The number of mrcc records in this snarl
00040 const int J = mrRecord->mrevt->GetEntriesFast();
00041 // Go through all the mrcc records in this snarl
00042 for(int j = 0; j < J; ++j){
00043 const NtpMREvent* mrevt = (NtpMREvent*)(mrRecord->mrevt->At(j));
00044 assert(mrevt);
00045 // See if any of them are matched up to the current event
00046 if(mrevt->best_event == i){
00047 FillEventInformationHelper(mrevt, stRecord, antp, truth);
00048 // Assume there is only one match. If there are more then there's
00049 // nothing sensible we can do about it anyway.
00050 return;
00051 }
00052 } // end for j
00053 // No matches, leave antp alone (it should already be default)
00054 }
|
|
||||||||||||||||||||
|
||||||||||||
|
Return the RO PID value for event ev in snarl st, reading the appropriate training files if necessary Definition at line 254 of file ANtpInfoObjectFillerMRCC.cxx. Referenced by FillEventInformationHelper(). 00255 {
00256 // ***********
00257 // Don't calculate the kNN stuff. It's too slow
00258 // ***********
00259 return -1;
00260
00261 /*
00262 // TODO: This code copied wholesale from ANtpInfoObjectFillerNC. Should rationalize.
00263
00264 static bool once=false;
00265 static Anp::Interface anpint;
00266
00267 if(!once){
00268 once=true;
00269 //set the location of the weight files based on the detector
00270 TString weightFileName = "knn.train.far.cedar.daikon.root";
00271 Detector::Detector_t det=st->GetVldContext()->GetDetector();
00272 if(det == Detector::kNear) weightFileName = "knn.train.near.cedar.daikon.root";
00273
00274 TString base = getenv("SRT_PRIVATE_CONTEXT");
00275 TString ncutils = "/NCUtils/data/";
00276 if(base != "" && base != "."){
00277 //check that the private context director exists, if not use public context
00278 void *dirptr = gSystem->OpenDirectory(base+ncutils);
00279 if(!dirptr){
00280 base = getenv("SRT_PUBLIC_CONTEXT");
00281 }//end if private context doesnt exist
00282 }//end if private context is defined
00283 else base = getenv("SRT_PUBLIC_CONTEXT");
00284
00285 //check that the public context exists, if not assert false
00286 if(base == ""){
00287 MSG("ObjectFillerMRCC", Msg::kFatal) << "no SRT_PUBLIC_CONTEXT set"
00288 << endl;
00289 assert(false);
00290 }
00291
00292 TString weightFilePath = base+ncutils+weightFileName;
00293 TString baseConf = getenv("SRT_PUBLIC_CONTEXT");
00294
00295 Registry reg;
00296 reg.Set("InterfaceConfigPath",
00297 baseConf+"/PhysicsNtuple/Config/Config2007Real.txt");
00298 reg.Set("FillkNNFilePath", weightFilePath);
00299
00300 anpint.Config(reg);
00301 }
00302
00303 static int prevSnarl=-1;
00304 int thisSnarl=st->GetHeader().GetSnarl();
00305 // Only refill the Anp interface once per snarl
00306 if(thisSnarl!=prevSnarl){
00307 prevSnarl=thisSnarl;
00308 // Gah, I wish const correctness wasn't such a pain
00309 if(!anpint.FillSnarl(const_cast<NtpStRecord*>(st))){
00310 MSG("ObjectFillerMRCC", Msg::kFatal) << "Couldn't set up Anp::Interface" << endl;
00311 // Dummy message to make sure it exits here
00312 MSG("ObjectFillerMRCC", Msg::kFatal) << "Goodbye" << endl;
00313 }
00314 }
00315
00316 // Gah, I wish const correctness wasn't such a pain
00317 return anpint.GetVar("knn_pid", const_cast<NtpSREvent*>(ev));
00318 */
00319 }
|
1.3.9.1