#include <RecJobHistory.h>
Public Types | |
| typedef enum RecJobHistory::EJobType | JobType_t |
| typedef std::map< std::string, RecJobRecord * > | JobRecordMap |
| typedef JobRecordMap::iterator | JobRecordMapItr |
| typedef JobRecordMap::const_iterator | JobRecordMapConstItr |
| enum | EJobType { kUnknownJobType = 0x0000, kRaw = 0x0001, kGMinos = 0x0002, kPTSim = 0x0004, kPhotonTransport = 0x0008, kCand = 0x0010, kNtpMC = 0x0020, kNtpTH = 0x0040, kNtpSR = 0x0080, kNtpSt = 0x0100 } |
Public Member Functions | |
| RecJobHistory () | |
| RecJobHistory (const RecJobHistory &) | |
| virtual | ~RecJobHistory () |
| const char * | JobTypeAsString (JobType_t jobtype) const |
| const RecJobRecord * | GetJobRecord (JobType_t jobtype) const |
| const RecJobRecord * | GetJobRecord (const char *jobtypestr) const |
| const JobRecordMap & | GetJobRecordMap () const |
| virtual std::ostream & | Print (std::ostream &os) const |
| virtual void | Print (Option_t *option="") const |
| virtual bool | Append (const RecJobHistory &that) |
| virtual bool | CreateJobRecord (JobType_t jobtype) |
| virtual bool | CreateJobRecord (const char *jobtypestr) |
| virtual bool | CreateJobRecord (JobType_t jobtype, const char *prodname, const char *codename, const char *hostname, const VldTimeStamp ×tamp) |
| virtual bool | CreateJobRecord (const char *jobtypestr, const char *prodname, const char *codename, const char *hostname, const VldTimeStamp ×tamp) |
| virtual bool | CreateJobRecord (JobType_t jobtype, const RecJobRecord &jobrec_tocopy) |
| virtual bool | CreateJobRecord (const char *jobtypestr, const RecJobRecord &jobrec_tocopy) |
| virtual ReleaseType::Release_t | GetProdReleaseType (UInt_t jobtypemask=(kGMinos|kCand)) const |
Static Public Attributes | |
| const UInt_t | kNJobType = 10 |
Private Member Functions | |
| virtual bool | AdoptJobRecord (const char *, RecJobRecord *jobrec) |
Private Attributes | |
| JobRecordMap | fJobRecordMap |
|
|
Definition at line 42 of file RecJobHistory.h. Referenced by Append(), and GetJobRecordMap(). |
|
|
Definition at line 44 of file RecJobHistory.h. Referenced by Append(), GetJobRecord(), GetProdReleaseType(), and Print(). |
|
|
Definition at line 43 of file RecJobHistory.h. Referenced by AdoptJobRecord(), and ~RecJobHistory(). |
|
|
|
|
|
Definition at line 27 of file RecJobHistory.h. Referenced by GetProdReleaseType(). 00027 {
00028 // Enumerated list of job types.
00029 kUnknownJobType = 0x0000,
00030 kRaw = 0x0001,
00031 kGMinos = 0x0002,
00032 kPTSim = 0x0004,
00033 kPhotonTransport = 0x0008,
00034 kCand = 0x0010,
00035 kNtpMC = 0x0020,
00036 kNtpTH = 0x0040,
00037 kNtpSR = 0x0080,
00038 kNtpSt = 0x0100
00039 } JobType_t;
|
|
|
Definition at line 30 of file RecJobHistory.cxx. References MSG. 00030 {
00031 // Default constructor
00032
00033 MSG("Rec",Msg::kDebug) << "RecJobHistory default ctor @ " << this << endl;
00034
00035 }
|
|
|
Definition at line 38 of file RecJobHistory.cxx. 00038 : TObject(that) {
00039 // Copy constructor
00040
00041 MSG("Rec",Msg::kDebug) << "RecJobHistory copy ctor @ " << this << endl;
00042 Append(that);
00043
00044 }
|
|
|
Definition at line 47 of file RecJobHistory.cxx. References fJobRecordMap, JobRecordMapItr, and MSG. 00047 {
00048 // Destructor
00049
00050 MSG("Rec",Msg::kDebug) << "RecJobHistory dtor @ " << this << endl;
00051
00052 JobRecordMapItr itr;
00053 for ( itr = fJobRecordMap.begin(); itr != fJobRecordMap.end(); itr++ ) {
00054 RecJobRecord* jobrecord = itr->second;
00055 delete jobrecord;
00056 }
00057 fJobRecordMap.clear();
00058
00059 }
|
|
||||||||||||
|
Definition at line 248 of file RecJobHistory.cxx. References fJobRecordMap, JobRecordMapItr, and MSG. Referenced by CreateJobRecord(). 00249 {
00250 // Insert job ptr to map with the specified jobtypestr as key.
00251 // If entry already exists, user will be warned and then entry
00252 // will be overrriden with new record.
00253 // Return true if success. Return false if jobtypestr is "UnknownJobType"
00254 // and no insertion will be made in this case.
00255
00256 if ( std::string(jobtypestr) == "UnknownJobType" ) {
00257 MSG("Rec",Msg::kWarning) << "RecJobHistory::CreateJobRecord "
00258 << "received Unknown jobtypestr " << jobtypestr
00259 << ". Ignored." << endl;
00260 return false;
00261 }
00262
00263 JobRecordMapItr itr = fJobRecordMap.find(jobtypestr);
00264
00265 if ( itr != fJobRecordMap.end() ) {
00266 // Found record map entry of same job type. Check to see if
00267 // it is an equivalent record, otherwise Print warning.
00268 if ( *(itr->second) != *jobrec ) {
00269 MSG("Rec",Msg::kWarning) << "RecJobHistory::CreateJobRecord "
00270 << "Found existing entry of requested type "
00271 << jobtypestr << ". Replaced."
00272 << endl;
00273 }
00274 delete (itr->second); // delete old record
00275 itr->second = jobrec; // insert new
00276 }
00277 else {
00278 fJobRecordMap.insert(make_pair(jobtypestr,jobrec));
00279 }
00280
00281 return true;
00282
00283 }
|
|
|
Definition at line 154 of file RecJobHistory.cxx. References CreateJobRecord(), GetJobRecordMap(), JobRecordMap, and JobRecordMapConstItr. Referenced by RecordSetupModule::Get(), NtpStModule::Get(), DetSim::Get(), RecJobHistory(), NtpTHModule::Reco(), NtpSRModule::Reco(), NtpMCModule::Reco(), and DataQualityReader::Reco(). 00154 {
00155 // Append the contents of that's history to this.
00156
00157 JobRecordMapConstItr citr;
00158 const JobRecordMap& thatJobRecordMap = that.GetJobRecordMap();
00159 bool allpass = true;
00160 for ( citr = thatJobRecordMap.begin(); citr != thatJobRecordMap.end();
00161 citr++ ) {
00162 allpass &= CreateJobRecord((citr->first).c_str(),*(citr->second));
00163 }
00164
00165 return allpass;
00166
00167 }
|
|
||||||||||||
|
Definition at line 234 of file RecJobHistory.cxx. References AdoptJobRecord(). 00235 {
00236 // Create job record from the input jobrec_tocopy and insert it in
00237 // the fJobRecordMap with the specified jobtypestr as key. Return true
00238 // if successful, or false if jobtypestr is "UnknownJobType".
00239
00240 RecJobRecord* jobrec = new RecJobRecord(jobrec_tocopy);
00241 bool isOk = AdoptJobRecord(jobtypestr,jobrec);
00242 if ( !isOk ) delete jobrec;
00243 return isOk;
00244
00245 }
|
|
||||||||||||
|
Definition at line 223 of file RecJobHistory.cxx. References CreateJobRecord(), and JobTypeAsString(). 00224 {
00225 // Create job record as copy from the input jobrec_tocopy and insert it
00226 // in the fJobRecordMap with the associated jobtype string as key.
00227 // Return true if successful, or false if jobtype is unknown.
00228
00229 return CreateJobRecord(JobTypeAsString(jobtype),jobrec_tocopy);
00230
00231 }
|
|
||||||||||||||||||||||||
|
Definition at line 206 of file RecJobHistory.cxx. References AdoptJobRecord(), and hostname. 00209 {
00210 // Create job record from arguments and insert it in
00211 // the fJobRecordMap with the specified jobtypestr as key. Return true
00212 // if successful or false if jobtypestr is "UnknownJobType".
00213
00214 RecJobRecord* jobrec = new RecJobRecord(prodname,codename,hostname,
00215 timestamp);
00216 bool isOk = AdoptJobRecord(jobtypestr,jobrec);
00217 if ( !isOk ) delete jobrec;
00218 return isOk;
00219
00220 }
|
|
||||||||||||||||||||||||
|
Definition at line 193 of file RecJobHistory.cxx. References CreateJobRecord(), hostname, and JobTypeAsString(). 00195 {
00196 // Create job record from arguments and insert it in the
00197 // fJobRecordMap with the associated jobtype string as key.
00198 // Return true if successful, or false if jobtype is unknown.
00199
00200 return CreateJobRecord(JobTypeAsString(jobtype),prodname,codename,
00201 hostname,timestamp);
00202
00203 }
|
|
|
Definition at line 180 of file RecJobHistory.cxx. References AdoptJobRecord(). 00180 {
00181 // Create job record from current job environment and insert it in
00182 // the fJobRecordMap with the specified jobtypestr as key. Return true
00183 // if successful, or false if jobtypestr is "UnknownJobType".
00184
00185 RecJobRecord* jobrec = new RecJobRecord();
00186 bool isOk = AdoptJobRecord(jobtypestr,jobrec);
00187 if ( !isOk ) delete jobrec;
00188 return isOk;
00189
00190 }
|
|
|
Definition at line 170 of file RecJobHistory.cxx. References JobTypeAsString(). Referenced by Append(), RotoObjectifier::BuildRecord(), CreateJobRecord(), RerootToTruthModule::Get(), RecordSetupModule::Get(), PhotonTransport::Get(), NtpStModule::Get(), DetSim::Get(), PTSimModule::Reco(), NtpTHModule::Reco(), NtpSRModule::Reco(), NtpMCModule::Reco(), and DataQualityReader::Reco(). 00170 {
00171 // Create job record from current job environment and insert it in the
00172 // fJobRecordMap with the associated jobtype string as key.
00173 // Return true if successful, or false if jobtype is unknown.
00174
00175 return CreateJobRecord(JobTypeAsString(jobtype));
00176
00177 }
|
|
|
Definition at line 108 of file RecJobHistory.cxx. References fJobRecordMap, and JobRecordMapConstItr. 00108 {
00109 // Get job record by character string job type.
00110 // Return null if not found.
00111
00112 JobRecordMapConstItr citr = fJobRecordMap.find(jobtypestr);
00113 if ( citr != fJobRecordMap.end() ) return citr->second;
00114 else return 0;
00115
00116 }
|
|
|
Definition at line 97 of file RecJobHistory.cxx. References JobTypeAsString(). Referenced by GetProdReleaseType(). 00097 {
00098 // Get ptr to job record by enumerated job type.
00099 // Return null if not found.
00100
00101 std::string jobtypestr = JobTypeAsString(jobtype);
00102 if ( jobtypestr == "UnknownJobType" ) return 0;
00103
00104 return GetJobRecord(jobtypestr.c_str());
00105 }
|
|
|
Definition at line 55 of file RecJobHistory.h. References JobRecordMap. Referenced by Append(). 00055 { return fJobRecordMap; }
|
|
|
Definition at line 286 of file RecJobHistory.cxx. References EJobType, fJobRecordMap, GetJobRecord(), RecJobRecord::GetProdReleaseType(), JobRecordMapConstItr, kNJobType, and kUnknownJobType. Referenced by NtpStRecord::GetRelease(). 00287 {
00288 // Get OR of production release types associated with job records selected
00289 // as specified in the input jobtypemask. jobtypemask corresponds
00290 // to a bit mask of OR'ed EJobTypes.
00291 // The default is to return the OR of production release types corresponding
00292 // to records of type kCand or kGMinos.
00293 // Specifying jobtypemask = EJobType::kUnknownJobType requests the OR of all
00294 // record release types in the job history.
00295 // Returns ReleaseType::kUnknown if unknown.
00296
00297 ReleaseType::Release_t release = ReleaseType::kUnknown;
00298
00299 if ( kUnknownJobType == jobtypemask ) {
00300 // Loop over all records in the history and construct OR of release types
00301 JobRecordMapConstItr citr;
00302 for ( citr = fJobRecordMap.begin(); citr != fJobRecordMap.end(); citr++ ) {
00303 ReleaseType::Release_t recrelease = citr->second->GetProdReleaseType();
00304 if ( recrelease != ReleaseType::kUnknown ) {
00305 if ( release != ReleaseType::kUnknown ) release |= recrelease;
00306 else release = recrelease;
00307 }
00308 }
00309 return release;
00310 }
00311
00312 // Otherwise, seek records of jobtype matching those specified in jobtypemask
00313 for ( UInt_t it = 0; it < kNJobType-1; it++ ) {
00314 UInt_t jobbit = 1 << it;
00315 if ( jobbit & jobtypemask ) {
00316 EJobType jobtype = static_cast<EJobType>(jobbit);
00317 const RecJobRecord* jobrecord = GetJobRecord(jobtype);
00318 if ( jobrecord ) {
00319 ReleaseType::Release_t recrelease = jobrecord->GetProdReleaseType();
00320 if ( recrelease != ReleaseType::kUnknown ) {
00321 if ( release != ReleaseType::kUnknown ) release |= recrelease;
00322 else release = recrelease;
00323 }
00324 }
00325 }
00326 }
00327
00328 return release;
00329
00330 }
|
|
|
Definition at line 62 of file RecJobHistory.cxx. References kCand, kGMinos, kNtpMC, kNtpSR, kNtpSt, kNtpTH, kPhotonTransport, kPTSim, kRaw, kUnknownJobType, and MSG. Referenced by CreateJobRecord(), and GetJobRecord(). 00062 {
00063 // Purpose: Convert enumerated jobtype to a string.
00064
00065 switch (jobtype) {
00066
00067 case kRaw:
00068 return "Raw";
00069 case kGMinos:
00070 return "GMinos";
00071 case kPTSim:
00072 return "PTSim";
00073 case kPhotonTransport:
00074 return "PhotonTransport";
00075 case kCand:
00076 return "Cand";
00077 case kNtpMC:
00078 return "NtpMC";
00079 case kNtpTH:
00080 return "NtpTH";
00081 case kNtpSR:
00082 return "NtpSR";
00083 case kNtpSt:
00084 return "NtpSt";
00085 case kUnknownJobType:
00086 return "UnknownJobType";
00087 default:
00088 MSG("Rec",Msg::kWarning)
00089 << "RecJobHistory::JobTypeAsString called with unknown JobType_t "
00090 << (int)jobtype << ". Fix method. Abort." << endl;
00091 abort();
00092 } // end of switch
00093
00094 }
|
|
|
Definition at line 144 of file RecJobHistory.cxx. References Print(). 00144 {
00145 // Purpose: Print header in form supported by TObject::Print.
00146
00147 Print(std::cout);
00148
00149 return;
00150
00151 }
|
|
|
Definition at line 119 of file RecJobHistory.cxx. References fJobRecordMap, and JobRecordMapConstItr. Referenced by RecRecordImp< T >::Print(), RecMinos::Print(), Print(), RawRecord::Print(), and CandRecord::Print(). 00119 {
00120 // Purpose: Print history on ostream. Job records are printed in
00121 // sequential order by timestamp.
00122
00123 std::map<const RecJobRecord*,std::string,compareJobRecord> recmapbytime;
00124 JobRecordMapConstItr citr;
00125 for ( citr = fJobRecordMap.begin(); citr != fJobRecordMap.end(); citr++ ) {
00126 recmapbytime.insert(make_pair(citr->second,citr->first));
00127 }
00128
00129 os << "RecJobHistory:";
00130 if ( recmapbytime.empty() ) os << " <<empty>>" << endl;
00131 else os << endl;
00132
00133 std::map<const RecJobRecord*,std::string,compareJobRecord>::const_iterator
00134 tcitr;
00135 for ( tcitr = recmapbytime.begin(); tcitr != recmapbytime.end(); tcitr++ ) {
00136 os << tcitr->second << "\t" << *(tcitr->first) << endl;
00137 }
00138
00139 return os;
00140
00141 }
|
|
|
Definition at line 97 of file RecJobHistory.h. Referenced by AdoptJobRecord(), GetJobRecord(), GetProdReleaseType(), Print(), and ~RecJobHistory(). |
|
|
Definition at line 24 of file RecJobHistory.cxx. Referenced by GetProdReleaseType(). |
1.3.9.1