void checkOpenHLT::saveHistograms(const TString & name) { std::locale loc; std::string nameArray[4]; fillNameArray(nameArray); for( int i=0; i<4; ++i ) { std::string nameCopy(nameArray[i]); TString namePart(name + std::toupper(nameArray[i][0], loc) + nameCopy.erase(0,1)); TCanvas * canvas = new TCanvas; canvas->cd(); histoMap_[namePart]->Draw(); canvas->Print(dir_+namePart+".pdf"); canvas->Print(dir_+namePart+".gif"); for( int j=i+1; j<4; ++j ) { std::stringstream ss; ss << i << "_" << j; TString correlationName(name+"Correlation_"+ss.str()); canvas->cd(); histoMap_[correlationName]->Draw(); histoMap_[correlationName]->SetMarkerStyle(1); // canvas->Print(dir_+correlationName+".pdf"); // canvas->Print(dir_+correlationName+".gif"); } } }
void checkOpenHLT::prepareHistograms(const TString & name, const int bins, const double & min, const double & max, const TString & axisTitle) { std::locale loc; std::string nameArray[4]; fillNameArray(nameArray); for( int i=0; i<4; ++i ) { std::string nameCopy(nameArray[i]); TString namePart(name + std::toupper(nameArray[i][0], loc) + nameCopy.erase(0,1)); histoMap_.insert(std::make_pair(namePart, new TH1F(namePart, name + "of the " + nameArray[i] + " muon", bins, min, max))); histoMap_[namePart]->GetXaxis()->SetTitle(axisTitle); for( int j=i+1; j<4; ++j ) { std::stringstream ss; ss << i << "_" << j; TString correlationName(name+"Correlation_"+ss.str()); histoMap_.insert(std::make_pair(correlationName, new TH2F(correlationName, name + "correlation of the " + nameArray[i] + " and " + nameArray[j] + " muons", bins, min, max, bins, min, max))); ss.str(""); ss << " (" << i << ")"; histoMap_[correlationName]->GetXaxis()->SetTitle(axisTitle + ss.str()); ss.str(""); ss << " (" << j << ")"; histoMap_[correlationName]->GetYaxis()->SetTitle(axisTitle + ss.str()); } } }
/* * This method will execute the JNI exception handling logic. It is responsible for * gathering exception information and then logging it and throwing the right exception. * * NOTE: Although it doesn't declare that it throws any sort of exception, be aware * that it will! */ void JavaRTI::exceptionCheck() { // check locally to see if there was an exception received if( this->eName.empty() ) return; // log the exception information at the INFO level this->logger->info( "Exception received: %s", this->eName.c_str() ); this->logger->info( "%s", this->eReason.c_str() ); // clear the exception information now that it has been handled /////////////////////////////////////////////////////////////////// // The checkAndThrow method will throw an exception if there is // // one to be thrown. However, we have to clear the existing data // // because otherwise the next time we call exceptionCheck() the // // old information will still be stored and it will look like we // // have an exception to deal with. Once we throw the exception, // // we won't have a chance to clean up. So, we copy the name and // // reason, clear out the existing values and then proceed. // //////////////////////////////////////////////////////////////////// string nameCopy( eName ); string reasonCopy( eReason ); this->eName.clear(); this->eReason.clear(); ExceptionHacks::checkAndThrow( nameCopy, reasonCopy ); }