Sources/src/FromTrackerPrototypeData_source.cc
void TrackerPrototypeDataDetail::managePrincipals ( int runNumber,
      int subRunNumber,
      int eventNumber,
      art::RunPrincipal*&    outR,
      art::SubRunPrincipal*& outSR,
      art::EventPrincipal*&  outE){

    art::Timestamp ts;

    if (currentEvent == printAtEvent){
      std::cout << "Event " << currentEvent << std::endl;
      printAtEvent = (printAtEvent+1)*2-1;
    }
    currentEvent++;


    if (first_call){
      outR = pm_.makeRunPrincipal(runNumber, ts);
      first_call = false;
    }
    art::SubRunID newID(runNumber, subRunNumber);

    if(newID != lastSubRunID_) {
      std::cout << "Subrun " << subRunNumber << std::endl;
      // art takes ownership of the object pointed to by outSR and will delete it at the appropriate time.
      outSR = pm_.makeSubRunPrincipal(runNumber,
          subRunNumber,
          ts);

    }
    lastSubRunID_ = newID;

    // art takes ownership of the object pointed to by outE and will delete it at the appropriate time.
    outE = pm_.makeEventPrincipal(runNumber, subRunNumber, eventNumber, ts, false);

  }
// Each time that we encounter a new run, a new subRun or a new event, we need to make a new principal
// of the appropriate type.  This code does not need to change as the number and type of data products changes.
Each time that we encounter a new run, a new subRun or a new event, we need to make a new principal
of the appropriate type.  This code does not need to change as the number and type of data products changes.
Each time that we encounter a new run a new subRun or a new event we need to make a new principal of the appropriate type . This code does not need to change as the number and type of data products changes .
void TrackerPrototypeDataDetail::managePrincipals ( int runNumber,
      int subRunNumber,
      int eventNumber,
      art::RunPrincipal*&    outR,
      art::SubRunPrincipal*& outSR,
      art::EventPrincipal*&  outE){
    art::Timestamp ts;
    if (currentEvent == printAtEvent){
      std::cout << "Event " << currentEvent << std::endl;
      printAtEvent = (printAtEvent+1)*2-1;
    }
    currentEvent++;
    if (first_call){
      outR = pm_.makeRunPrincipal(runNumber, ts);
      first_call = false;
    }
    art::SubRunID newID(runNumber, subRunNumber);
    if(newID != lastSubRunID_) {
      std::cout << "Subrun " << subRunNumber << std::endl;
      outSR = pm_.makeSubRunPrincipal(runNumber,
          subRunNumber,
          ts);
    }
    lastSubRunID_ = newID;
    outE = pm_.makeEventPrincipal(runNumber, subRunNumber, eventNumber, ts, false);
  }
void TrackerPrototypeDataDetail :: managePrincipals ( int runNumber , int subRunNumber , int eventNumber , art :: RunPrincipal * & outR , art :: SubRunPrincipal * & outSR , art :: EventPrincipal * & outE ) { art :: Timestamp ts ; if ( currentEvent == printAtEvent ) { std :: cout << " " << currentEvent << std :: endl ; printAtEvent = ( printAtEvent + 1 ) * 2 - 1 ; } currentEvent ++ ; if ( first_call ) { outR = pm_ . makeRunPrincipal ( runNumber , ts ) ; first_call = false ; } art :: SubRunID newID ( runNumber , subRunNumber ) ; if ( newID != lastSubRunID_ ) { std :: cout << " " << subRunNumber << std :: endl ; outSR = pm_ . makeSubRunPrincipal ( runNumber , subRunNumber , ts ) ; } lastSubRunID_ = newID ; outE = pm_ . makeEventPrincipal ( runNumber , subRunNumber , eventNumber , ts , false ) ; }
Each time that we encounter a new run, a new subRun or a new event, we need to make a new principal
of the appropriate type.
Each time that we encounter a new run a new subRun or a new event we need to make a new principal of the appropriate type .
// art takes ownership of the object pointed to by outSR and will delete it at the appropriate time. // art takes ownership of the object pointed to by outE and will delete it at the appropriate time.