Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper functions for PMT to photon production process matching #132

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tgrbrooks
Copy link
Contributor

Added to shared library so can be used in root macros.

Example macro:

void pmtMatchTest()
{

  // Create an event reader from the input file
  RAT::DSReader reader("../../ratmacros/test.root"); // path to your rat-pac files

  // Loop through the events
  int num_events = reader.GetT()->GetEntries();
  std::cout<<"Number of events = "<<num_events<<"\n";
  for(int i = 0; i < 10/*num_events*/; i++){

    RAT::DS::Root *event = reader.NextEvent();

    // Get the monte-carlo information
    RAT::DS::MC *mc = event->GetMC();
    for(int j = 0; j < mc->GetMCPMTCount(); j++){
      RAT::DS::MCPMT *pmt = mc->GetMCPMT(j);
      std::cout<<"MCPMT "<<j<<" ProcessFromEnergy = "<<RAT::ProcessFromEnergy(pmt)<<" ProcessFromNHit = "<<RAT::ProcessFromNHit(pmt)<<"\n";
    }   
    for(int j = 0; j < event->GetEVCount(); j++){
      RAT::DS::EV* trig = event->GetEV(j);
      for(int k = 0; k < event->GetEV(j)->GetPMTCount(); k++){                                                                                                
        RAT::DS::PMT *pmt = event->GetEV(j)->GetPMT(k);
        std::cout<<"PMT "<<k<<" ProcessFromEnergy = "<<RAT::ProcessFromEnergy(pmt, event)<<" ProcessFromNHit = "<<RAT::ProcessFromNHit(pmt, event)<<"\n";
      }   
    }   

  }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant