Use Standalone WebBunchTrainCrossingTool On D3PD

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

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2010-12-16 - HaifengLi
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback