]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added -skip-datatype argument; automatically add format specifier if pattern of ...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Nov 2008 13:16:20 +0000 (13:16 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Nov 2008 13:16:20 +0000 (13:16 +0000)
HLT/BASE/util/AliHLTFileWriter.cxx
HLT/BASE/util/AliHLTFileWriter.h

index 7ae1e13d69deb4036fcefccd0d6f87f0d7a75e2b..96934088b68ac1c60dc0c020a27238f7cc55a453 100644 (file)
@@ -120,6 +120,9 @@ int AliHLTFileWriter::DoInit( int argc, const char** argv )
       argument.ReplaceAll("-subdir", "");
       if (argument.BeginsWith("=")) {
        fSubDirFormat=argument.Replace(0,1,"");
+       if (strchr(fSubDirFormat.Data(), '%')==NULL) {
+         fSubDirFormat+="%lu";
+       }
       } else {
        fSubDirFormat="event%03lu";
       }
@@ -181,6 +184,10 @@ int AliHLTFileWriter::DoInit( int argc, const char** argv )
       SetMode(kWriteAllEvents);
       SetMode(kWriteAllBlocks);
 
+      // -skip-datatype
+    } else if(argument.CompareTo("-skip-datatype")==0){
+      SetMode(kSkipDataType);
+
     } else {
       if ((iResult=ScanArgument(argc-i, &argv[i]))==-EINVAL) {
        HLTError("unknown argument %s", argument.Data());
@@ -345,7 +352,8 @@ int AliHLTFileWriter::BuildFileName(const AliHLTEventID_t eventID, const int blo
   if (blockID>=0 && !CheckMode(kConcatenateBlocks)) {
     if (!fBlcknoFormat.IsNull())
       filename+=Form(fBlcknoFormat, blockID);
-    if (dataType!=kAliHLTVoidDataType) {
+    if (dataType!=kAliHLTVoidDataType &&
+       !CheckMode(kSkipDataType)) {
       filename+="_";
       filename+=AliHLTComponent::DataType2Text(dataType).data();
     }
index 01d1dc0ded03f3334073072d6e0ca8759f48d675..0524626bcb8f777f1742cbae3f7896f009876c21 100644 (file)
  * \li -subdir[=pattern] <br>
  *      create sub dir for each event, the format pattern can contain printf
  *      specifiers to print the event no into the dir name, default is
- *      'event%03d' (-subdir w/o additional pattern)
+ *      'event%%03lu' (-subdir w/o additional pattern). The format specifyer
+ *      %%lu is automatically added if missing in the pattern. Please note the
+ *      \b long int type of the event id                                   <br>
  *      \b note: the idfmt string is reset since the subdir contains the id
  * \li -idfmt[=pattern] <br>
  *      format specifier for the event id in the file name,                <br>
- *      default: on, default pattern: '_0x%08x'
+ *      default: on, default pattern: '_0x%%08x'
  * \li -specfmt[=pattern] <br>
  *      format specifier for the data specification in the file name       <br>
- *      default: off, default pattern: '_0x%08x'
+ *      default: off, default pattern: '_0x%%08x'
  * \li -blocknofmt[=pattern] <br>
  *      format specifier for the block no in the file name                 <br>
- *      default: on, default pattern: '_0x%02x'
+ *      default: on, default pattern: '_0x%%02x'
+ * \li -skip-datatype <br>
+ *      do not consider data type when building the file name.
  * \li -enumerate <br>
  *      don't use the event number but an event counter beginning from 0
  * \li -concatenate-blocks <br>
  * printf format specifiers in order to print the corresponding variable. E.g.
  * <pre>
  * -specfmt             append specification
- * -subdir=test_%d      store in sub folders
- * -blocknofmt=_0x%   format block no in hex
- * -idfmt=_%04d         print id in 4-digits decimal number
+ * -subdir=test         store in sub folders
+ * -blocknofmt=_0x%%x   format block no in hex
+ * -idfmt=_%%04d        print id in 4-digits decimal number
  * -idfmt=              print no id
  * </pre>
  *
@@ -249,7 +253,10 @@ class AliHLTFileWriter : public AliHLTDataSink  {
     kWriteAllEvents = 0x8,
 
     /** write all blocks including private ones */
-    kWriteAllBlocks = 0x10
+    kWriteAllBlocks = 0x10,
+
+    /** skip the data type information when creating the file name */
+    kSkipDataType = 0x20
   };
 
  private: