Index: trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 5144)
+++ trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 5307)
@@ -103,5 +103,5 @@
     : fFileNames(NULL), fNumFile(0), fIn(NULL), fParList(NULL), fInterleave(1)
 {
-    fName  = name  ? name  : "MRawFileRead";
+    fName  = name  ? name  : "MRead";
     fTitle = title ? title : "Read task to read DAQ binary files";
 
@@ -122,4 +122,27 @@
     if (fIn)
         delete fIn;
+}
+
+Byte_t MRawFileRead::IsFileValid(const char *name)
+{
+    ifstream fin(name);
+    if (!fin)
+        return 0;
+
+    Byte_t c[4];
+    fin.read((char*)c, 4);
+    if (!fin)
+        return 0;
+
+    if (c[0]!=0xc0)
+        return 0;
+
+    if (c[1]==0xc0)
+        return 1;
+
+    if (c[1]==0xc1)
+        return 2;
+
+    return 0;
 }
 
Index: trunk/MagicSoft/Mars/mraw/MRawFileRead.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 5144)
+++ trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 5307)
@@ -32,4 +32,6 @@
     ~MRawFileRead();
 
+    static Byte_t IsFileValid(const char *name);
+
     void SetInterleave(UInt_t i) { fInterleave = i; }
 
