Introduction
This tool,
WebBunchTrainCrossingToolSA, is written by Attila Krasznahorkay.
You can go to the
TrigBunchCrossingTool to more information.
This page will only describe the experience to adopt this tool to my analysis code.
Software enviroment
ROOT
You don't need Athena.
Check out tool and compile it
1. Check out
TrigBunchCrossingTool
svn co svn+ssh://svn.cern.ch/reps/atlasoff/Trigger/TrigAnalysis/TrigBunchCrossingTool/tags/TrigBunchCrossingTool-00-00-08
2. Compile
cd TrigBunchCrossingTool-00-00-08/cmt/
make -f Makefile.standalone
3. Path of head files and library
library : /users/haifeng/scratch/TrigBunchCrossingTool-00-00-08/standalone/libTrigBunchCrossingTool.a
header : /users/haifeng/scratch/TrigBunchCrossingTool-00-00-08
4. Change Makefile. Open the Makefile of your analysis code.
Add
CXXFLAGS += -DSTANDALONE
CXXFLAGS += -I/users/haifeng/scratch/TrigBunchCrossingTool-00-00-08
LIBS += /users/haifeng/scratch/TrigBunchCrossingTool-00-00-08/standalone/libTrigBunchCrossingTool.a
Integrate to your analysis code
#include "src/WebBunchCrossingToolSA.h"
template< typename T >
std::ostream& operator<< ( std::ostream& out, const std::vector< T >& vec ) {
out << "[";
typename std::vector< T >::const_iterator itr = vec.begin();
typename std::vector< T >::const_iterator end = vec.end();
for( ; itr != end; ++itr ) {
out << *itr;
if( ++itr != end ) {
out << ", ";
}
--itr;
}
out << "]";
return out;
}
int main(){
// Create tge tool and load the configuration for run 162347 lumiblock 50:
Trig::WebBunchCrossingToolSA bctool;
if( ! bctool.loadConfig( 167575 , 50 ) ) {
std::cerr << "Couldn't load configuration!" << std::endl;
}
// Interrogate BCID 51 from that lumiblock:
std::cout << "Is BCID = 51 filled?: " << bctool.isFilled( 51 ) << std::endl;
std::cout << "Is BCID = 51 in a train?: " << bctool.isInTrain( 51 ) << std::endl;
std::vector< bool > bunches = bctool.bunchesInFront( 51, 32 );
std::cout << "Bunches in front of BCID = 51: " << bunches << std::endl;
/// Load the configuration with BG key 109:
if( ! bctool.loadConfig( 109 ) ) {
std::cerr << "Couldn't load configuration!" << std::endl;
return 255;
}
// Interrogate BCID 37 in this configuration:
std::cout << "Is BCID = 37 filled?: " << bctool.isFilled( 37 ) << std::endl;
std::cout << "Is BCID = 37 in a train?: " << bctool.isInTrain( 37 ) << std::endl;
bunches = bctool.bunchesInFront( 37, 32 );
std::cout << "Bunches in front of BCID = 37: " << bunches << std::endl;
int df = bctool.distanceFromFront(37, Trig::IIBunchCrossingTool::BunchCrossings) ;
std::cout << "Distance from Front BCID = 37: " << df << std::endl;
return 0
}
Remark
You don't need the library when you run your code. Because the
BunchTrainCrossingTool is static library.
So you can send the binary file to grid via prun job.
This tool is using web interface from some trigger sever. So you have to think about when you want to submit
large scale jobs.
--
HaifengLi - 25-Oct-2010